hlsdemux/hlsdemux2: Convert uppercase letters to lowercase, when adding a language... 98/320798/5 accepted/tizen/unified/20250320.120241 accepted/tizen/unified/x/20250320.221629
authorGilbok Lee <gilbok.lee@samsung.com>
Fri, 7 Mar 2025 08:52:22 +0000 (17:52 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Mon, 10 Mar 2025 08:09:16 +0000 (17:09 +0900)
- The gst_tag_check_language_code() function only checks for lowercase letters
  to verify the ISO-639 language code, so if the EXT-X-MEDIA language attribute comes in uppercase,
  it has been modified to convert it to lowercase and check it.

[Version] 1.24.11-7
[Issue Type] Fix bugs

Change-Id: I771a84be560876baf034e17eeffcc6d2bcc03f66

packaging/gstreamer.spec
subprojects/gst-plugins-bad/ext/hls/gsthlsdemux.c
subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux.c
subprojects/gst-plugins-good/meson.build

index 718a92a7002b4f98d10bf903bbcc855e69b4c122..2f26fe5f0e03ea5e6b9967203b1a27a1919e73fe 100644 (file)
@@ -60,7 +60,7 @@
 
 Name:           %{_name}
 Version:        1.24.11
-Release:        6
+Release:        7
 Summary:        Streaming-Media Framework Runtime
 License:        LGPL-2.0+
 Group:          Multimedia/Framework
index af40668e22251137c7e13ba7bb60504d020ce2d7..94eeaf2be9df7f302c7d41970680531c1632d01f 100644 (file)
@@ -2411,15 +2411,26 @@ gst_hlsdemux_set_language_tags (GstAdaptiveDemuxStream * stream,
     const gchar * language)
 {
   GstTagList *lang_tag = NULL;
+  gchar *lower_language = NULL;
 
-  if (!stream)
+  if (!stream) {
+    GST_WARNING ("stream is NULL");
     return FALSE;
+  }
 
-  if (gst_tag_check_language_code (language))
-    lang_tag = gst_tag_list_new (GST_TAG_LANGUAGE_CODE, language, NULL);
+  if (!language) {
+    GST_WARNING ("language is NULL");
+    return FALSE;
+  }
+
+  lower_language = g_ascii_strdown(language, -1);
+  if (lower_language && gst_tag_check_language_code (lower_language))
+    lang_tag = gst_tag_list_new (GST_TAG_LANGUAGE_CODE, lower_language, NULL);
   else
     lang_tag = gst_tag_list_new (GST_TAG_LANGUAGE_NAME, language, NULL);
 
+  g_free (lower_language);
+
   if (!lang_tag)
     return FALSE;
 
index f4d5dea0d3ea08182eda755e02aa89fe91d6f61b..9ce55bbbae355dcc6b2ca5ac47841dc041ae417a 100644 (file)
@@ -477,12 +477,23 @@ gst_hls_demux_new_track_for_rendition (GstHLSDemux * demux,
   if (rendition->lang) {
     if (tags == NULL)
       tags = gst_tag_list_new_empty ();
+#ifdef TIZEN_FEATURE_HLSDEMUX2_LANG_TAG
+    gchar *lower_lang = g_ascii_strdown(rendition->lang, -1);
+    if (lower_lang && gst_tag_check_language_code (lower_lang))
+      gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_LANGUAGE_CODE,
+          lower_lang, NULL);
+    else
+      gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_LANGUAGE_NAME,
+          rendition->lang, NULL);
+    g_free (lower_lang);
+#else
     if (gst_tag_check_language_code (rendition->lang))
       gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_LANGUAGE_CODE,
           rendition->lang, NULL);
     else
       gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_LANGUAGE_NAME,
           rendition->lang, NULL);
+#endif
   }
 
   if (stream_type == GST_STREAM_TYPE_TEXT)
index 1a6b6c3a46923cea2ed57714b76bbb2d374079b7..5b47ec6d6ce275fa117e449ffc0f1564223974cd 100644 (file)
@@ -467,6 +467,7 @@ cdata.set('TIZEN_FEATURE_SOUP_MODIFICATION', true)
 cdata.set('TIZEN_FEATURE_RGVOLUME_MODIFICATION', true)
 cdata.set('TIZEN_FEATURE_DISABLE_V4L2_DEPENDENCY', true)
 cdata.set('TIZEN_FEATURE_AVIDEMUX_MODIFICATION', true)
+cdata.set('TIZEN_FEATURE_HLSDEMUX2_LANG_TAG', true)
 cdata.set('TIZEN_FEATURE_USE_LIBV4L2', true)
 cdata.set('TIZEN_FEATURE_V4L2_ADDITIONAL_CID_SUPPORT', true)
 cdata.set('TIZEN_FEATURE_VPX_MODIFICATION', true)