uridecodebin3: propagate about-to-finish for new inputs
authorEdward Hervey <edward@centricular.com>
Tue, 9 Aug 2022 08:26:00 +0000 (10:26 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 23 Nov 2022 12:19:22 +0000 (12:19 +0000)
If the pending next urisourcebin is already draining, make sure we propagate it
when activating it.

Fixes gapless playback of small entries

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1588

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3457>

subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c

index ceccb74..d599da6 100644 (file)
@@ -1113,9 +1113,17 @@ switch_and_activate_input_locked (GstURIDecodeBin3 * uridecodebin,
   /* and set new one as input item */
   uridecodebin->input_item = new_item;
 
+  /* If the new source is already drained, propagate about-to-finish */
+  if (new_item->pending_about_to_finish) {
+    emit_and_handle_about_to_finish (uridecodebin, new_item);
+  }
+
+  /* Finally propagate pending buffering message */
   if (new_item->main_item->handler->pending_buffering_msg) {
     GstMessage *msg = new_item->main_item->handler->pending_buffering_msg;
     new_item->main_item->handler->pending_buffering_msg = NULL;
+    GST_DEBUG_OBJECT (uridecodebin,
+        "Posting pending buffering message %" GST_PTR_FORMAT, msg);
     PLAY_ITEMS_UNLOCK (uridecodebin);
     GST_BIN_CLASS (parent_class)->handle_message ((GstBin *) uridecodebin, msg);
     PLAY_ITEMS_LOCK (uridecodebin);