From: Tim-Philipp Müller Date: Sun, 13 Dec 2009 13:10:12 +0000 (+0000) Subject: qtdemux: fix up language code extraction some more X-Git-Tag: RELEASE-0.10.18~185 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c4c8f8670fa3fee644ac18899c264b8065f03f8;p=platform%2Fupstream%2Fgst-plugins-good.git 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. --- 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 */