asfdemux: fix seeking back after EOS has been reached in push mode
authorVootele Vesterblom <vov@bang-olufsen.dk>
Tue, 12 May 2015 08:08:55 +0000 (11:08 +0300)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 27 May 2016 16:18:32 +0000 (17:18 +0100)
Fix seeking when demuxer is in INDEX state. This happens when we
reached the end of the stream. It should still be possible to do
a flushing seek and seek back to any other position though. Instead
the demuxer would just go straight to EOS again instead of going
back to processing packets again from the new position.

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

gst/asfdemux/gstasfdemux.c

index 27bba9c678ac5d4dc935ae181e07774432e7fe3f..f65bf821b03110dbccd05bf0c50eb9946c4a0d99 100644 (file)
@@ -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 packet 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);
 
       gst_event_unref (event);