From 8ddbc26dedcf83962dd3aed90a6bb0a95847d386 Mon Sep 17 00:00:00 2001 From: James Almer Date: Sat, 16 Nov 2024 17:54:34 -0300 Subject: [PATCH] avformat/mov: don't unconditionally set all audio packets in fragments as key frames Some audio codecs, like TrueHD, have non key frames. Signed-off-by: James Almer --- libavformat/mov.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index d6983be20b..ce7a2f69c4 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -6003,10 +6003,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom) pts = AV_NOPTS_VALUE; } - if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) - keyframe = 1; - else - keyframe = + keyframe = !(sample_flags & (MOV_FRAG_SAMPLE_FLAG_IS_NON_SYNC | MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES)); if (keyframe) {