diff options
author | Jan Schmidt <thaytan@noraisin.net> | 2009-06-30 16:31:12 +0100 |
---|---|---|
committer | Jan Schmidt <thaytan@noraisin.net> | 2009-07-13 19:30:50 +0100 |
commit | 6fd890d65f11fe4da6257944f993a91dd8b6c5f7 (patch) | |
tree | 24114b04eed3064f9086bdc69390180c543f4766 /ext | |
parent | 0c042686058d1ed6d68333ccd78ffe8bda01879a (diff) | |
download | gst-plugins-bad-6fd890d65f11fe4da6257944f993a91dd8b6c5f7.tar.gz gst-plugins-bad-6fd890d65f11fe4da6257944f993a91dd8b6c5f7.tar.bz2 gst-plugins-bad-6fd890d65f11fe4da6257944f993a91dd8b6c5f7.zip |
resindvd: Don't send empty language code strings
Ignore empty language codes on some poorly coded DVDs, rather than
setting empty strings into our outgoing taglist.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/resindvd/resindvdsrc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/resindvd/resindvdsrc.c b/ext/resindvd/resindvdsrc.c index 7b44bf9c..38be6394 100644 --- a/ext/resindvd/resindvdsrc.c +++ b/ext/resindvd/resindvdsrc.c @@ -1904,7 +1904,9 @@ rsn_dvdsrc_prepare_streamsinfo_event (resinDvdSrc * src) gst_structure_set (s, t, G_TYPE_INT, (int) a->audio_format, NULL); g_free (t); - if (a->lang_type) { + /* Check that the language code is flagged and at least somewhat valid + * before putting it in the output structure */ + if (a->lang_type && a->lang_code > 0x100) { t = g_strdup_printf ("audio-%d-language", i); lang_code[0] = (a->lang_code >> 8) & 0xff; lang_code[1] = a->lang_code & 0xff; @@ -1913,7 +1915,7 @@ rsn_dvdsrc_prepare_streamsinfo_event (resinDvdSrc * src) GST_DEBUG_OBJECT (src, "Audio stream %d is language %s", i, lang_code); } else - GST_DEBUG_OBJECT (src, "Audio stream %d - no language %s", i, lang_code); + GST_DEBUG_OBJECT (src, "Audio stream %d - no language", i); } if (have_audio == FALSE) { @@ -1947,7 +1949,7 @@ rsn_dvdsrc_prepare_streamsinfo_event (resinDvdSrc * src) g_free (t); t = g_strdup_printf ("subpicture-%d-language", i); - if (u->type) { + if (u->type && u->lang_code > 0x100) { lang_code[0] = (u->lang_code >> 8) & 0xff; lang_code[1] = u->lang_code & 0xff; gst_structure_set (s, t, G_TYPE_STRING, lang_code, NULL); |