aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2019-12-12 09:32:07 -0300
committerJames Almer <jamrial@gmail.com>2019-12-12 11:38:34 -0300
commitaedffc0b220bd47d2a4f5bd3ca751e4e51c500c7 (patch)
treecb05a642ad91991efcfbdf9930fcfc94e4708484
parent29f8d4e9477ccab7d52eef4f15c00b56286d7551 (diff)
downloadffmpeg-aedffc0b220bd47d2a4f5bd3ca751e4e51c500c7.tar.gz
avcodec/mlp_parser: mark sync frames as key frames
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavcodec/mlp_parser.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
index b5d3ff7226..5d2ddc5a70 100644
--- a/libavcodec/mlp_parser.c
+++ b/libavcodec/mlp_parser.c
@@ -61,6 +61,8 @@ static int mlp_parse(AVCodecParserContext *s,
int ret;
int i, p = 0;
+ s->key_frame = 0;
+
*poutbuf_size = 0;
if (buf_size == 0)
return 0;
@@ -136,6 +138,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 +163,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;