[Bug 749066] asfdemux: gstasfdemux goes to EOS when demux->packet >= demux->num_packets and seeking

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Tue May 24 20:31:59 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=749066

Tim-Philipp Müller <t.i.m at zen.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |t.i.m at zen.co.uk

--- Comment #3 from Tim-Philipp Müller <t.i.m at zen.co.uk> ---
This can be reproduced with a pipeline like this:

 gst-launch-1.0 filesrc location=song.wma ! queue ! asfdemux ! queue
max-size-bytes=0 max-size-buffers=0 max-size-time=0 ! fakesink silent=true

Set to playing, wait a second or so (until file has been processed and asfdemux
reache EOS), then do a flushing seek back to wherever.

I would suggest the following variant of your patch, so it's (a) clearer what
the purpose of this is, and (b) it's not triggered at the initial segment event
when asfdemux->data_offset is still 0 because the header hasn't been parsed
(and start will be 0, so then 0 >= 0).

diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c
index 27bba9c..ae419ec 100644
--- a/gst/asfdemux/gstasfdemux.c
+++ b/gst/asfdemux/gstasfdemux.c
@@ -428,6 +428,11 @@ gst_asf_demux_sink_event (GstPad * pad, GstObject *
parent, GstEvent * event)
       demux->need_newsegment = TRUE;
       demux->segment_seqnum = gst_event_get_seqnum (event);
       gst_asf_demux_reset_stream_state_after_discont (demux);
+      /* if we seek back after reaching EOS, go back to data reading state */
+      if (demux->data_offset > 0 && segment->start >= demux->data_offset
+          && demux->state == GST_ASF_DEMUX_STATE_INDEX) {
+        demux->state = GST_ASF_DEMUX_STATE_DATA;
+      }
       GST_OBJECT_UNLOCK (demux);

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list