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.
This commit is contained in:
Tim-Philipp Müller 2009-12-13 13:10:12 +00:00
parent b66f914586
commit 6c4c8f8670

View file

@ -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 */