GNOME Bugzilla – Bug 438610
[dvddemux] fails after flushing seek
Last modified: 2007-05-16 12:52:58 UTC
Basically, dvddemux stores downstream flow returns so it can aggregate these. In case of a flushing seek, FLUSH_START comes through and can make (some) downstream subsequently return WRONG_STATE. If the seek (and FLUSH_STOP) have finished and streaming resumes, the stored WRONG_STATE has not been cleared, making dvddemux (or mpegdemux) wrongly conclude/aggregate there is a real problem downstream. This typically then leads to the pipeline pausing/terminating. [well, yes, there is flupsdemux as well, but it does not (yet) seem to have a taste for subtitles, and that makes working/testing on bug #415754 a bit difficult ;-)]
Created attachment 88208 [details] [review] Patch to clear stored flow return * When receiving FLUSH_STOP; clear internally stored downstream flow returns Note this patches across dvddemux and mpegdemux (due to inheritance etc involved).
Argh, what a dumb mistake. I bet this also solves the problems people have with Thoggen's cropping dialog. Is there a reason for the extensive if (flow != GST_FLOW_NOT_LINKED) stream->last_flow = GST_FLOW_OK logic that I'm missing (ie. opposed to just resetting the last_flow), or is this just a copy'n'paste artefact?
Use of the flow variable may indeed be an artefact. As for the if-logic, I thought it was not necessary (or prudent) to reset a state indicating the pad is not linked. Then again, it may also not hurt doing the reset anyway, and letting it be re-discovered that some are not linked.
Created attachment 88287 [details] [review] slightly cleaner version
Thanks a lot, committed: 2007-05-16 Tim-Philipp Müller <tim at centricular dot net> Based on patch by: Mark Nauwelaerts <manauw skynet be> * gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_process_event): * gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init), (gst_mpeg_demux_process_event), (gst_mpeg_streams_reset_last_flow): * gst/mpegstream/gstmpegdemux.h: Reset last_flow values for the various streams after a flushing seek, otherwise we might aggregate wrong flow returns afterwards that will make upstream pause silently. This should fix seeking in DVDs and also fix the Thoggen cropping dialog (#438610). Can't believe this wasn't noticed before the 0.10.5 release :-/