summaryrefslogtreecommitdiff
path: root/libavcodec/mlpdec.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2014-09-26 13:49:20 +0200
committerAnton Khirnov <anton@khirnov.net>2015-03-11 16:03:13 +0100
commitf36f6a608b5b2c17f8876195c61621c8f8607cee (patch)
treee5d7c5da68afb664c2d9f8c24f8651bf641276cf /libavcodec/mlpdec.c
parent448c8cfe4c53e9e806effd8505b46d57fa707061 (diff)
mlpdec: support major sync headers with optional extension blocks
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/mlpdec.c')
-rw-r--r--libavcodec/mlpdec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 624efc152e..8f1b6f42c6 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -132,6 +132,9 @@ typedef struct MLPDecodeContext {
/// Current access unit being read has a major sync.
int is_major_sync_unit;
+ /// Size of the major sync unit, in bytes
+ int major_sync_header_size;
+
/// Set if a valid major sync block has been read. Otherwise no decoding is possible.
uint8_t params_valid;
@@ -346,6 +349,8 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
return AVERROR_PATCHWELCOME;
}
+ m->major_sync_header_size = mh.header_size;
+
m->access_unit_size = mh.access_unit_size;
m->access_unit_size_pow2 = mh.access_unit_size_pow2;
@@ -1105,7 +1110,7 @@ static int read_access_unit(AVCodecContext *avctx, void* data,
if (read_major_sync(m, &gb) < 0)
goto error;
m->is_major_sync_unit = 1;
- header_size += 28;
+ header_size += m->major_sync_header_size;
}
if (!m->params_valid) {