Commit c6e9c67f authored by Edward Hervey's avatar Edward Hervey Committed by Edward Hervey

qtdemux: Properly reset demuxer when all streams are EOS

Make sure offset and neededbytes are properly resetted when all
streams are EOS in push-mode.

Avoids cases when some data might still be pushed by upstream (because
it didn't yet see the resulting GST_FLOW_EOS yet) and qtdemux gets
completely lost.

https://bugzilla.gnome.org/show_bug.cgi?id=781266
parent 8586150a
......@@ -6885,6 +6885,7 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force)
/* skip this data, stream is EOS */
gst_adapter_flush (demux->adapter, demux->neededbytes);
demux->offset += demux->neededbytes;
/* check if all streams are eos */
ret = GST_FLOW_EOS;
......@@ -6894,11 +6895,6 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force)
break;
}
}
if (ret == GST_FLOW_EOS) {
GST_DEBUG_OBJECT (demux, "All streams are EOS, signal upstream");
goto eos;
}
} else {
GstBuffer *outbuf;
......@@ -6929,6 +6925,13 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force)
GST_LOG_OBJECT (demux, "offset is now %" G_GUINT64_FORMAT,
demux->offset);
if (ret == GST_FLOW_EOS) {
GST_DEBUG_OBJECT (demux, "All streams are EOS, signal upstream");
demux->neededbytes = -1;
goto eos;
}
if ((demux->neededbytes = next_entry_size (demux)) == -1) {
if (demux->fragmented) {
GST_DEBUG_OBJECT (demux, "(temporarily) out of fragmented samples");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment