Skip to content

Commit

Permalink
Add gst-plugins-base patch
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaski committed Aug 22, 2024
1 parent db00ccc commit 168e8c0
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2598,6 +2598,11 @@ jobs:
working-directory: build
run: tar -xf ../downloads/gst-plugins-base-${{env.gstreamer_version}}.tar.xz

- name: Patch gst-plugins-base
shell: bash
working-directory: build/gst-plugins-base-${{env.gstreamer_version}}
run: patch -p3 < ../../patches/gst-plugins-base-fixes.patch

- name: Configure gst-plugins-base
shell: bash
env:
Expand Down
69 changes: 69 additions & 0 deletions patches/gst-plugins-base-fixes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
From ea59c921d692e7626d07e54ac9933cfebf24ebe7 Mon Sep 17 00:00:00 2001
From: Edward Hervey <[email protected]>
Date: Wed, 21 Aug 2024 16:29:03 +0200
Subject: [PATCH] decodebin3: Fix collection identity check

Collections can be auto-generated from upstream and yet have exactly the same
streams in it.

Therefore do a more in-depth check for equality.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7401>
---
.../gst/playback/gstdecodebin3.c | 26 ++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c
index 56ef496468ac..78b79c776ba6 100644
--- a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c
+++ b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c
@@ -2609,6 +2609,29 @@ db_collection_new (GstStreamCollection * collection)
return db_collection;
}

+static gboolean
+collections_are_identical (GstStreamCollection * collection,
+ GstStreamCollection * previous)
+{
+ guint i;
+
+ if (collection == previous)
+ return TRUE;
+
+ if (gst_stream_collection_get_size (collection) !=
+ gst_stream_collection_get_size (previous))
+ return FALSE;
+
+ for (i = 0; i < gst_stream_collection_get_size (previous); i++) {
+ GstStream *stream = gst_stream_collection_get_stream (previous, i);
+ const gchar *sid = gst_stream_get_stream_id (stream);
+ if (!stream_in_collection (collection, (gchar *) sid))
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
/** handle_stream_collection_locked:
* @dbin:
* @collection: (transfer none): The new collection for @input. Can be %NULL.
@@ -2683,12 +2706,13 @@ handle_stream_collection_locked (GstDecodebin3 * dbin,
if (dbin->input_collection) {
GstStreamCollection *previous = dbin->input_collection->collection;

- if (collection == previous) {
+ if (collections_are_identical (collection, previous)) {
GST_DEBUG_OBJECT (dbin, "Collection didn't change");
gst_object_unref (collection);
SELECTION_UNLOCK (dbin);
return NULL;
}
+
/* Check if this collection is an update of the previous one */
if (gst_stream_collection_get_size (collection) >
gst_stream_collection_get_size (previous)) {
--
GitLab

0 comments on commit 168e8c0

Please sign in to comment.