From 2834973d55c2c3256dcb28978d2ed43a5e1470c1 Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Sat, 17 Feb 2024 21:00:09 +0000 Subject: [PATCH] parsebin: Fix stream type for encrypted streams Without this patch the stream type for encrypted streams would be 'unknown'. Part-of: --- subprojects/gst-plugins-base/gst/playback/gstparsebin.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/subprojects/gst-plugins-base/gst/playback/gstparsebin.c b/subprojects/gst-plugins-base/gst/playback/gstparsebin.c index c72d4cc8c2..2440395c9a 100644 --- a/subprojects/gst-plugins-base/gst/playback/gstparsebin.c +++ b/subprojects/gst-plugins-base/gst/playback/gstparsebin.c @@ -3978,6 +3978,11 @@ guess_stream_type_from_caps (GstCaps * caps) s = gst_caps_get_structure (caps, 0); name = gst_structure_get_name (s); + if (gst_structure_has_field (s, "original-media-type")) { + /* Caps describe an encrypted payload, use original-media-type to determine stream type. */ + name = gst_structure_get_string (s, "original-media-type"); + } + if (g_str_has_prefix (name, "video/") || g_str_has_prefix (name, "image/")) return GST_STREAM_TYPE_VIDEO; if (g_str_has_prefix (name, "audio/"))