mpegtsdemux: add DESC_DVB_SUBTITLING descriptor for language parsing

This commit is contained in:
Janne Grunau 2010-12-15 14:39:56 +01:00 committed by Sebastian Dröge
parent eaf1b316b0
commit 431ea2c697

View file

@ -948,29 +948,32 @@ gst_mpegts_demux_send_tags_for_stream (GstMpegTSDemux * demux,
GstTagList *list = NULL;
if (stream->ES_info) {
guint8 *iso639_languages =
gst_mpeg_descriptor_find (stream->ES_info, DESC_ISO_639_LANGUAGE);
if (iso639_languages) {
if (DESC_ISO_639_LANGUAGE_codes_n (iso639_languages)) {
const gchar *lc;
gchar lang_code[4];
gchar *language_n;
guint8 lang_descs[] = { DESC_ISO_639_LANGUAGE, DESC_DVB_SUBTITLING };
for (gint i = 0; i < sizeof (lang_descs); i++) {
guint8 *iso639_languages =
gst_mpeg_descriptor_find (stream->ES_info, lang_descs[i]);
if (iso639_languages) {
if (DESC_ISO_639_LANGUAGE_codes_n (iso639_languages)) {
const gchar *lc;
gchar lang_code[4];
gchar *language_n;
language_n = (gchar *)
DESC_ISO_639_LANGUAGE_language_code_nth (iso639_languages, 0);
language_n = (gchar *)
DESC_ISO_639_LANGUAGE_language_code_nth (iso639_languages, 0);
lang_code[0] = language_n[0];
lang_code[1] = language_n[1];
lang_code[2] = language_n[2];
lang_code[3] = 0;
lang_code[0] = language_n[0];
lang_code[1] = language_n[1];
lang_code[2] = language_n[2];
lang_code[3] = 0;
if (!list)
list = gst_tag_list_new ();
if (!list)
list = gst_tag_list_new ();
/* descriptor contains ISO 639-2 code, we want the ISO 639-1 code */
lc = gst_tag_get_language_code (lang_code);
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_LANGUAGE_CODE, (lc) ? lc : lang_code, NULL);
/* descriptor contains ISO 639-2 code, we want the ISO 639-1 code */
lc = gst_tag_get_language_code (lang_code);
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
GST_TAG_LANGUAGE_CODE, (lc) ? lc : lang_code, NULL);
}
}
}
}