Hello!
I have pipeline with multiple sinks - one of them is synced (this is a renderer) and the other one is unsynced (filesink). This pipeline contains one filesrc.
I'm wondering what is the best way to end playback "on demand". This pipeline is used in some kind of videoplayer and user can close it during playing.
As far as I understand, the most popular way to end playback is to put EOS event and wait for EOS message appearing on the bus. After that, pipeline is set to NULL state. This ensures that filesink will close file without dropping any buffers. This is how application works now. User can press "Q" and application is closed after a split second. At least, this is how application works in most cases.
Opened movie can contain gaps with lengths reaching several hours. If user decides to close application during such gap, it may lead to some sort of hang, because EOS event waits on synced sink to end of the gap. This, of course, means that no EOS message is posted, so, from user point of view, application did not responded properly. Bad.
Of course, I could skip this whole EOS thing and set pipeline to NULL immediately after pressing "Q", but this could lead in filesink not saving all buffers to file. Bad.
I thought about waiting for EOS message coming from filesink only and setting pipeline to NULL immediately after that - without waiting for EOS message from renderer. But I am afraid that this solution is rather a "hacky" one.
What would you advised?
Thanks in advance!
Andrzej.