diff options
author | Guido Cella <guido@guidocella.xyz> | 2022-08-20 11:25:03 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2022-09-20 19:35:25 +0200 |
commit | 565e7d906c0da59739b60f5a3760ed9eb067f1f9 (patch) | |
tree | 136e5038c74f540328916c320d8ec894636c3867 | |
parent | 4856a7bd591ab9c294fd0540f3acf74657432951 (diff) | |
download | mpv-565e7d906c0da59739b60f5a3760ed9eb067f1f9.tar.bz2 mpv-565e7d906c0da59739b60f5a3760ed9eb067f1f9.tar.xz |
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.
-rw-r--r-- | demux/demux_lavf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 0602f7c3d1..160ce6cd97 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -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; |