File ffmpeg-avcodec-libdav1d-don-t-repeatedly-parse-the-same-seq.patch of Package ffmpeg-4.34059

From 7ee17ec7e46afef0e0af20af196292ec75f50b62 Mon Sep 17 00:00:00 2001
From: James Almer <jamrial@gmail.com>
Date: Sat, 26 Jun 2021 17:24:15 -0300
Subject: [PATCH] avcodec/libdav1d: don't repeatedly parse the same sequence
 header

Look at the event flag that signals a new sequence header was found
in the bitstream on supported libdav1d versions for this purpose.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/libdav1d.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Index: ffmpeg-4.4/libavcodec/libdav1d.c
===================================================================
--- ffmpeg-4.4.orig/libavcodec/libdav1d.c
+++ ffmpeg-4.4/libavcodec/libdav1d.c
@@ -33,6 +33,9 @@
 #include "decode.h"
 #include "internal.h"
 
+#define FF_DAV1D_VERSION_AT_LEAST(x,y) \
+    (DAV1D_API_VERSION_MAJOR > (x) || DAV1D_API_VERSION_MAJOR == (x) && DAV1D_API_VERSION_MINOR >= (y))
+
 typedef struct Libdav1dContext {
     AVClass *class;
     Dav1dContext *c;
openSUSE Build Service is sponsored by