ffmpeg | branch: release/5.0 | James Almer <jamr...@gmail.com> | Thu Apr  7 
15:27:57 2022 -0300| [0d487be837872df255ef174399b9140eeaa9152a] | committer: 
James Almer

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 <jamr...@gmail.com>
(cherry picked from commit 3e186148ca9ac0c47cec253fdea62b48c9feadd2)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0d487be837872df255ef174399b9140eeaa9152a
---

 libavcodec/libdav1d.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 872e60e000..765c1a4bc4 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -381,7 +381,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);

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to