aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2022-04-07 15:27:57 -0300
committerJames Almer <jamrial@gmail.com>2022-04-07 15:28:50 -0300
commit3e186148ca9ac0c47cec253fdea62b48c9feadd2 (patch)
treeec48d7fe3dfbe60bac568c901495e755ad8ad668
parente3c4442b249acde1d50e7b0deb3422141c6248d8 (diff)
downloadffmpeg-3e186148ca9ac0c47cec253fdea62b48c9feadd2.tar.gz
avcodec/libdav1d: don't depend on the event flags API to init sequence params the first time
A bug was found in dav1d <= 1.0.0 where the event flag New Sequence Header would not be signaled for some samples using delayed random access points. It has since been fixed, but nonetheless it's best to ensure the AVCodecContext is filled with parameters when parsing the first frame, regardless of what events were signaled. Fixes ticket #9694. Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavcodec/libdav1d.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 64014123ce..0a46cf2264 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -382,7 +382,8 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
#if FF_DAV1D_VERSION_AT_LEAST(5,1)
dav1d_get_event_flags(dav1d->c, &event_flags);
- if (event_flags & DAV1D_EVENT_FLAG_NEW_SEQUENCE)
+ if (c->pix_fmt == AV_PIX_FMT_NONE ||
+ event_flags & DAV1D_EVENT_FLAG_NEW_SEQUENCE)
#endif
libdav1d_init_params(c, p->seq_hdr);
res = ff_decode_frame_props(c, frame);