videodecoder: Call drain() rather then finish() on segment-done
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 16 Jun 2021 18:49:14 +0000 (14:49 -0400)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 23 Jun 2021 20:31:06 +0000 (20:31 +0000)
The finish() virtual function documentation state that "Sub-classes can refuse
to decode new data after." Though, it is very common to issue a non-flushing
seek after that event in gapless playback uses case. This fixes potential
stalls with code using segment seeks, by using drain() virtual funciton
instead.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1206>

gst-libs/gst/video/gstvideodecoder.c

index 5df6f9c..a18d1a0 100644 (file)
@@ -1270,7 +1270,7 @@ gst_video_decoder_sink_event_default (GstVideoDecoder * decoder,
       GstFlowReturn flow_ret = GST_FLOW_OK;
 
       GST_VIDEO_DECODER_STREAM_LOCK (decoder);
-      flow_ret = gst_video_decoder_drain_out (decoder, TRUE);
+      flow_ret = gst_video_decoder_drain_out (decoder, FALSE);
       GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
       ret = (flow_ret == GST_FLOW_OK);