From 6c4c8f8670fa3fee644ac18899c264b8065f03f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 13 Dec 2009 13:10:12 +0000 Subject: [PATCH] qtdemux: fix up language code extraction some more Quicktime uses ISO 639-2 for language codes, but GST_TAG_LANGUAGE is supposed to hold a ISO 639-1 code, so convert as needed using the new API from -base. See #602126. --- gst/qtdemux/qtdemux.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index 9849af3e..63ab172 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -5415,10 +5415,15 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak) /* add some language tag, if useful */ if (stream->lang_code && strcmp (stream->lang_id, "unk") && strcmp (stream->lang_id, "und")) { + const gchar *lang_code; + if (!list) list = gst_tag_list_new (); + + /* convert ISO 639-2 code to ISO 639-1 */ + lang_code = gst_tag_get_language_code (stream->lang_id); gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, - GST_TAG_LANGUAGE_CODE, stream->lang_id, NULL); + GST_TAG_LANGUAGE_CODE, (lang_code) ? lang_code : stream->lang_id, NULL); } /* now we are ready to add the stream */ -- 2.7.4