diff mbox series

[FFmpeg-devel,7/7] avcodec/test/avcodec: check decoders for FF_CODEC_CAP_SETS_PKT_DTS

Message ID 20230709192110.5934-7-jamrial@gmail.com
State Accepted
Commit 2bbb6cf74eb8db58f2e1cbb862434f7ec8f9e95d
Headers show
Series [FFmpeg-devel,1/7] avcodec/av1dec: remove FF_CODEC_CAP_SETS_PKT_DTS flag | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer July 9, 2023, 7:21 p.m. UTC
Ensure that only decode() callback ones set it.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/tests/avcodec.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/tests/avcodec.c b/libavcodec/tests/avcodec.c
index bbf5289af2..08ca507bf0 100644
--- a/libavcodec/tests/avcodec.c
+++ b/libavcodec/tests/avcodec.c
@@ -175,6 +175,10 @@  int main(void){
                 !(codec->capabilities & AV_CODEC_CAP_FRAME_THREADS))
                 ERR("Decoder %s wants allocated progress without supporting"
                     "frame threads\n");
+            if (codec2->cb_type != FF_CODEC_CB_TYPE_DECODE &&
+                codec2->caps_internal & FF_CODEC_CAP_SETS_PKT_DTS)
+                ERR("Decoder %s is marked as setting pkt_dts when it doesn't have"
+                    "any effect\n");
         }
         if (priv_data_size_wrong(codec2))
             ERR_EXT("Private context of codec %s is impossibly-sized (size %d).",