mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
mpegtsdemux: add DESC_DVB_SUBTITLING descriptor for language parsing
This commit is contained in:
parent
eaf1b316b0
commit
431ea2c697
1 changed files with 22 additions and 19 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue