summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ashley <bugzilla@ashley-family.net>2015-08-18 10:52:11 +0100
committerTim-Philipp Müller <tim@centricular.com>2015-08-18 11:48:03 +0100
commit5d99d0dfa0a2b7fdedb26cc02de6c5dc74f09ddd (patch)
tree18fdbff03ed84386890b00413a27f743ff1797c2
parent13d49d9b3e7e0e15680838ef5a9c71a9d6269283 (diff)
qtdemux: fix offset calculation when parsing CENC aux info
Commit 7d7e54ce6863ff53e188d0276d2651b65082ffdb added support for DASH common encryption, however commit bb336840c0b0b02fa18dc4437ce0ded3d9142801 that went onto master shortly before the CENC commit caused the calculation of the CENC aux info offset to be incorrect. The base_offset was being added if present, but if the base_offset is relative to the start of the moof, the offset was being added twice. The correct approach is to calculate the offset from the start of the moof and use that offset when parsing the CENC aux info.
-rw-r--r--gst/isomp4/qtdemux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index 11d98ad1a..8393959c9 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -3389,8 +3389,8 @@ qtdemux_parse_moof (GstQTDemux * qtdemux, const guint8 * buffer, guint length,
g_free (info_sizes);
goto fail;
}
- offset += (base_offset > 0) ? (guint64) base_offset : 0;
-
+ if (base_offset > qtdemux->moof_offset)
+ offset += (guint64) (base_offset - qtdemux->moof_offset);
if (info_type == FOURCC_cenc && info_type_parameter == 0U) {
GstByteReader br;
if (offset > length) {