GNOME Bugzilla – Bug 659242
[matroskademux] Unexpected EOS when seeking on paused matroska file
Last modified: 2011-09-16 13:20:48 UTC
Created attachment 196718 [details] [review] Prevent the demuxer from sending EOS when doing a flushing seek while in paused state Create a pipeline similar to the following filesrc ! matroskademux ! queue ! ... Pause the pipeline and wait for it to preroll. Then do a flushing seek. Sometimes this will result in the demuxer sending an EOS. This is done from gst_matroska_demux_loop() because it gets a GST_FLOW_UNEXPECTED return value from the EBML-reader, from gst_ebml_peek_id_length(). This function will always return GST_FLOW_UNEXPECTED if the peek fails. No matter what the reason for the fail is. For example, in the situation above (when the EOS is sent) the reason for the peek failure is that the filesrc is flushing, and returns GST_FLOW_WRONG_STATE when the get_range function is called. But this never reaches the ebml reader, which instead returns a GST_FLOW_UNEXPECTED. I have attached a patch where I have changed the reader to return the correct value, i.e. the value that the peek function returns.
commit 11b0a0effcf0e23d9abf8425f191b932188e3a74 Author: Branko Subasic <branko@axis.com> Date: Fri Sep 16 15:03:23 2011 +0200 matroskademux: Avoid sending EOS when in paused state Changed the ebml reader's gst_ebml_peek_id_length() function so that it returns the actual reason for why the peek failed, instead of (almost) always returning GST_FLOW_UNEXPECTED. This prevents the pulling task from sending EOS when doing a flushing seek.