qtdemux: Do not mark stream as EOS only if all streams are EOS

The `GstFlowCombiner` is responsible for tracking the flow of each
stream and handle the overal flow return value. Without that, we
can end up with the following scenario:

- Audio+video stream
- Only the video stream is linked downstream
- The audio stream goes EOS, video doesn't yet
  -> We update the Flow in the combiner with OK as all streams are not EOS
- Video goes EOS because downstream returned EOS
-> `qtdemux` returns `FLOW_OK` forever because the unlinked audio pad
  has `last_flowret==FLOW_OK`

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5724>
This commit is contained in:
Thibault Saunier 2023-11-28 11:28:58 -03:00 committed by Sebastian Dröge
parent 8295b2ae5c
commit b1b29de0fb

View file

@ -8463,14 +8463,7 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force)
gst_adapter_flush (demux->adapter, demux->neededbytes);
demux->offset += demux->neededbytes;
/* check if all streams are eos */
ret = GST_FLOW_EOS;
for (i = 0; i < QTDEMUX_N_STREAMS (demux); i++) {
if (!STREAM_IS_EOS (QTDEMUX_NTH_STREAM (demux, i))) {
ret = GST_FLOW_OK;
break;
}
}
} else {
GstBuffer *outbuf;