decodebin: only emit 'drained' signal when top chain is drained
authoruno20001 <regisztralo111@gmail.com>
Wed, 27 May 2020 13:11:17 +0000 (15:11 +0200)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 27 May 2020 18:51:31 +0000 (18:51 +0000)
Without this, decodebin emits 'drained' multiple times which then
causes (uri)playbin to emit 'about-to-finish' multiple times for
for file types.

Fixes #751

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

gst/playback/gstdecodebin2.c

index 46f9a7f..2d8314f 100644 (file)
@@ -4249,7 +4249,7 @@ beach:
 
   *drained = chain->drained;
 
-  if (*drained)
+  if (*drained && !chain->parent)       /* only emit signal from top chain */
     g_signal_emit (dbin, gst_decode_bin_signals[SIGNAL_DRAINED], 0, NULL);
 
   return handled;