demux_lavf: detect avif images

Detect avif files with 1 frame as images. This works because AV1 videos
and AVIF animations have nb_frames 0 or > 1.
This commit is contained in:
Guido Cella 2022-08-20 11:25:03 +02:00 committed by sfan5
parent 4856a7bd59
commit 565e7d906c
1 changed files with 2 additions and 1 deletions

View File

@ -723,7 +723,8 @@ static void handle_new_stream(demuxer_t *demuxer, int i)
bstr_endswith0(bstr0(priv->avif->name), "_pipe") ||
strcmp(priv->avif->name, "alias_pix") == 0 ||
strcmp(priv->avif->name, "gif") == 0 ||
strcmp(priv->avif->name, "image2pipe") == 0
strcmp(priv->avif->name, "image2pipe") == 0 ||
(codec->codec_id == AV_CODEC_ID_AV1 && st->nb_frames == 1)
)) {
MP_VERBOSE(demuxer, "Assuming this is an image format.\n");
sh->image = true;