From fbdd1aa80064b3ea9d728e45abd14190b10bc8e0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
Date: Wed, 26 Mar 2025 15:32:05 +0200
Subject: [PATCH] dashsink: Make sure to use a non-NULL pad name when
 requesting a pad from splitmuxsink

If the caller passed in "audio_%u" instead of a concrete pad name into
gst_element_request_pad_simple() then the pad name will be NULL. In that case
use the pad template name for requesting the pad from splitmuxsink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8697>
---
 subprojects/gst-plugins-bad/ext/dash/gstdashsink.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/subprojects/gst-plugins-bad/ext/dash/gstdashsink.c b/subprojects/gst-plugins-bad/ext/dash/gstdashsink.c
index 3e525b2ad6..bf4abf9dbc 100644
--- a/subprojects/gst-plugins-bad/ext/dash/gstdashsink.c
+++ b/subprojects/gst-plugins-bad/ext/dash/gstdashsink.c
@@ -1066,6 +1066,9 @@ gst_dash_sink_request_new_pad (GstElement * element, GstPadTemplate * templ,
     stream->adaptation_set_id = ADAPTATION_SET_ID_SUBTITLE;
   }
 
+  if (!split_pad_name)
+    split_pad_name = templ->name_template;
+
   if (pad_name)
     stream->representation_id = g_strdup (pad_name);
   else