From 0a515acfa807788d87763b929fd684abd9853025 Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Sun, 11 Aug 2019 11:25:50 +0100 Subject: [PATCH] playbin3: Propagate sink context When the playsink's sink is activated its state is set to READY but it remains unlinked. So, in order for decodebin3 to potentially reuse the context later on, the whole playbin3 needs to have it internally stored. --- gst/playback/gstplaybin3.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gst/playback/gstplaybin3.c b/gst/playback/gstplaybin3.c index 12eaf72..f269fb5 100644 --- a/gst/playback/gstplaybin3.c +++ b/gst/playback/gstplaybin3.c @@ -3691,6 +3691,13 @@ activate_sink_bus_handler (GstBus * bus, GstMessage * msg, gst_element_post_message (GST_ELEMENT_CAST (playbin), msg); else gst_message_unref (msg); + } else if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_HAVE_CONTEXT) { + GstContext *context; + + gst_message_parse_have_context (msg, &context); + gst_element_set_context (GST_ELEMENT_CAST (playbin), context); + gst_context_unref (context); + gst_element_post_message (GST_ELEMENT_CAST (playbin), msg); } else { gst_element_post_message (GST_ELEMENT_CAST (playbin), msg); } -- 2.7.4