[FFmpeg-cvslog] avcodec/tiff: implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
Paul B Mahol
git at videolan.org
Sun Sep 25 19:33:23 EEST 2022
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Sep 25 15:59:13 2022 +0200| [1452445116f3a265762ffeb7fdc5b8f2fbaa2cfc] | committer: Paul B Mahol
avcodec/tiff: implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1452445116f3a265762ffeb7fdc5b8f2fbaa2cfc
---
libavcodec/tiff.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 302444cb0f..9c29cd5a73 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1209,6 +1209,10 @@ static int init_image(TiffContext *s, AVFrame *frame)
if (ret < 0)
return ret;
}
+
+ if (s->avctx->skip_frame >= AVDISCARD_ALL)
+ return 0;
+
if ((ret = ff_thread_get_buffer(s->avctx, frame, 0)) < 0)
return ret;
if (s->avctx->pix_fmt == AV_PIX_FMT_PAL8) {
@@ -1222,7 +1226,7 @@ static int init_image(TiffContext *s, AVFrame *frame)
pal[i] = 0xFFU << 24 | i * 255 / ((1<<s->bpp) - 1) * 0x010101;
}
}
- return 0;
+ return 1;
}
static void set_sar(TiffContext *s, unsigned tag, unsigned num, unsigned den)
@@ -2089,7 +2093,7 @@ again:
}
/* now we have the data and may start decoding */
- if ((ret = init_image(s, p)) < 0)
+ if ((ret = init_image(s, p)) <= 0)
return ret;
if (!s->is_tiled || has_strip_bits) {
@@ -2382,6 +2386,7 @@ const FFCodec ff_tiff_decoder = {
.close = tiff_end,
FF_CODEC_DECODE_CB(decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
- .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_ICC_PROFILES,
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_ICC_PROFILES |
+ FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM,
.p.priv_class = &tiff_decoder_class,
};
More information about the ffmpeg-cvslog
mailing list