X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fmlp_parser.c;h=9fea7db955e0a9e9561ac62e543ab1e82a9a199e;hb=bc70684e74a185d7b80c8b80bdedda659cb581b8;hp=b5d3ff7226a10efd574c77fee0c48b17d7efa249;hpb=c300fe13b6294f6386803feff685b52b3571656c;p=ffmpeg diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c index b5d3ff7226a..9fea7db955e 100644 --- a/libavcodec/mlp_parser.c +++ b/libavcodec/mlp_parser.c @@ -61,7 +61,10 @@ static int mlp_parse(AVCodecParserContext *s, int ret; int i, p = 0; + s->key_frame = 0; + *poutbuf_size = 0; + *poutbuf = NULL; if (buf_size == 0) return 0; @@ -136,6 +139,8 @@ static int mlp_parse(AVCodecParserContext *s, * access unit header and all the 2- or 4-byte substream headers. */ // Only check when this isn't a sync frame - syncs have a checksum. + s->key_frame = 0; + parity_bits = 0; for (i = -1; i < mp->num_substreams; i++) { parity_bits ^= buf[p++]; @@ -159,6 +164,8 @@ static int mlp_parse(AVCodecParserContext *s, if (ff_mlp_read_major_sync(avctx, &mh, &gb) < 0) goto lost_sync; + s->key_frame = 1; + avctx->bits_per_raw_sample = mh.group1_bits; if (avctx->bits_per_raw_sample > 16) avctx->sample_fmt = AV_SAMPLE_FMT_S32; @@ -201,7 +208,7 @@ lost_sync: return 1; } -AVCodecParser ff_mlp_parser = { +const AVCodecParser ff_mlp_parser = { .codec_ids = { AV_CODEC_ID_MLP, AV_CODEC_ID_TRUEHD }, .priv_data_size = sizeof(MLPParseContext), .parser_init = mlp_init,