diff --git a/libavformat/mov.c b/libavformat/mov.c index b5d3e93ad5..c2d2a07893 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2017,6 +2017,11 @@ static void mov_build_index(MOVContext *mov, AVStream *st) rap_group_index++; } } + if (sc->keyframe_absent + && !sc->stps_count + && !rap_group_present + && st->codec->codec_type == AVMEDIA_TYPE_AUDIO) + keyframe = 1; if (keyframe) distance = 0; sample_size = sc->alt_sample_size > 0 ? sc->alt_sample_size : sc->sample_sizes[current_sample];