diff mbox series

[FFmpeg-devel,2/3] lavc/speedhqdec: Obey AVDISCARD_ALL

Message ID ed6d3af6d55c1eb6eeebf3d52098af4f374a286d.camel@haerdin.se
State New
Headers show
Series [FFmpeg-devel,1/3] lavc/speedhqdec: Add AV_CODEC_CAP_FRAME_THREADS | expand

Commit Message

Tomas Härdin May 8, 2024, 12:42 p.m. UTC
Inspired by qoidec

/Tomas
diff mbox series

Patch

From ed49d383d40a9a4fad04b76bc7d86107c6350d9a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= <git@haerdin.se>
Date: Wed, 8 May 2024 14:17:57 +0200
Subject: [PATCH 2/3] lavc/speedhqdec: Obey AVDISCARD_ALL

---
 libavcodec/speedhqdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/speedhqdec.c b/libavcodec/speedhqdec.c
index e54e25cb25..d6b1fff7a5 100644
--- a/libavcodec/speedhqdec.c
+++ b/libavcodec/speedhqdec.c
@@ -424,6 +424,9 @@  static int speedhq_decode_frame(AVCodecContext *avctx, AVFrame *frame,
         return AVERROR_INVALIDDATA;
     }
 
+    if (avctx->skip_frame >= AVDISCARD_ALL)
+        return avpkt->size;
+
     compute_quant_matrix(s->quant_matrix, 100 - quality);
 
     second_field_offset = AV_RL24(buf + 1);
-- 
2.39.2