summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2014-07-21 18:11:16 +0100
committerTim-Philipp Müller <tim@centricular.com>2014-07-21 18:21:50 +0100
commit5122410f11560dff4e09d3365d051370c9e35ba7 (patch)
tree403bea0b3dbfb6ea548c7d0daee602adc0eee48a
parent60648012f395c708ba61e8937e03d75cc23bf6d5 (diff)
qtdemux: fix language code parsing for 3-letter codes starting with 'a'
And handle special value for 'unspecified' explicitly. https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/QTFFChap4/qtff4.html
-rw-r--r--gst/isomp4/qtdemux.c4
-rw-r--r--gst/isomp4/qtdemux_lang.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index f2ea73b6c..4348d1203 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -7321,8 +7321,10 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
lang_code = QT_UINT16 ((guint8 *) mdhd->data + 28);
}
- if (lang_code < 0x800) {
+ if (lang_code < 0x400) {
qtdemux_lang_map_qt_code_to_iso (stream->lang_id, lang_code);
+ } else if (lang_code == 0x7fff) {
+ stream->lang_id[0] = 0; /* unspecified */
} else {
stream->lang_id[0] = 0x60 + ((lang_code >> 10) & 0x1F);
stream->lang_id[1] = 0x60 + ((lang_code >> 5) & 0x1F);
diff --git a/gst/isomp4/qtdemux_lang.c b/gst/isomp4/qtdemux_lang.c
index 0c7a5d9f5..59a78d7e9 100644
--- a/gst/isomp4/qtdemux_lang.c
+++ b/gst/isomp4/qtdemux_lang.c
@@ -189,7 +189,7 @@ qtdemux_lang_map_qt_code_to_iso (gchar id[4], guint16 qt_lang_code)
{
const gchar *iso_code;
- g_assert (qt_lang_code < 0x800);
+ g_assert (qt_lang_code < 0x400);
if (qt_lang_code < G_N_ELEMENTS (qt_lang_map))
iso_code = qt_lang_map[qt_lang_code];