diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 41fea0c76c598067f14281f83c515f7cbbfb9cc2..c03f3ecf255d5e8e463dbc59d9082c59e7fed8f3 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -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");