From f36f6a608b5b2c17f8876195c61621c8f8607cee Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 26 Sep 2014 13:49:20 +0200 Subject: mlpdec: support major sync headers with optional extension blocks Signed-off-by: Anton Khirnov --- libavcodec/mlpdec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libavcodec/mlpdec.c') 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) { -- cgit v1.2.3