summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatej Knopp <matej.knopp@gmail.com>2016-02-06 14:39:05 +0100
committerTim-Philipp Müller <tim@centricular.com>2016-02-19 16:00:59 +0000
commitf96c9eb6bc8e1cf0e6191e1acf525b19ca5000d4 (patch)
tree083062546ebc0dffefa21d632c6b4de8dc5112c7
parentdf341f41dc0518bf7f0f8d1aa57f976bddc3ff9c (diff)
downloadgstreamer-plugins-good-f96c9eb6bc8e1cf0e6191e1acf525b19ca5000d4.tar.gz
qtdemux: workaround for files with wrong color_table_id value
Instead of erroring out, just use the default color table. https://bugzilla.gnome.org/show_bug.cgi?id=761637
-rw-r--r--gst/isomp4/qtdemux.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index 63314bcd4..ea6c4882c 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -8917,6 +8917,14 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
stream->bits_per_sample = QT_UINT16 (stsd_data + offset + 82);
stream->color_table_id = QT_UINT16 (stsd_data + offset + 84);
+ /* if color_table_id is 0, ctab atom must follow; however some files
+ * produced by TMPEGEnc have color_table_id = 0 and no ctab atom, so
+ * if color table is not present we'll correct the value */
+ if (stream->color_table_id == 0 &&
+ (len < 90 || QT_FOURCC (stsd_data + offset + 86) != FOURCC_ctab)) {
+ stream->color_table_id = -1;
+ }
+
GST_LOG_OBJECT (qtdemux, "width %d, height %d, bps %d, color table id %d",
stream->width, stream->height, stream->bits_per_sample,
stream->color_table_id);