1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/libdav1d: honor the requested skip_frame level

This allows dropping non-reference, non-intra, or non-key frames on supported
libdav1d versions.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2022-12-14 12:55:38 -03:00
parent 8ad988ac37
commit 7af947c0c0

View File

@ -260,6 +260,15 @@ static av_cold int libdav1d_init(AVCodecContext *c)
s.n_frame_threads, s.n_tile_threads);
#endif
#if FF_DAV1D_VERSION_AT_LEAST(6,8)
if (c->skip_frame >= AVDISCARD_NONKEY)
s.decode_frame_type = DAV1D_DECODEFRAMETYPE_KEY;
else if (c->skip_frame >= AVDISCARD_NONINTRA)
s.decode_frame_type = DAV1D_DECODEFRAMETYPE_INTRA;
else if (c->skip_frame >= AVDISCARD_NONREF)
s.decode_frame_type = DAV1D_DECODEFRAMETYPE_REFERENCE;
#endif
res = libdav1d_parse_extradata(c);
if (res < 0)
return res;