summaryrefslogtreecommitdiff
path: root/libavcodec/pngdec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-03-30 21:33:24 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-04-05 19:54:09 +0200
commitce7dbd0481f990e249c2a05f179228489d3062cf (patch)
treec5f04e58129705430e1d97a5842131b72e250083 /libavcodec/pngdec.c
parentfb59a42ef977dd91085a602f10c9c82f88d072e5 (diff)
downloadffmpeg-ce7dbd0481f990e249c2a05f179228489d3062cf.tar.gz
avcodec/codec_internal: Make FFCodec.decode use AVFrame*
This increases type-safety by avoiding conversions from/through void*. It also avoids the boilerplate "AVFrame *frame = data;" line for non-subtitle decoders. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/pngdec.c')
-rw-r--r--libavcodec/pngdec.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 73fda21ca0..59302c898a 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -1515,14 +1515,12 @@ fail:
}
#if CONFIG_PNG_DECODER
-static int decode_frame_png(AVCodecContext *avctx,
- void *data, int *got_frame,
- AVPacket *avpkt)
+static int decode_frame_png(AVCodecContext *avctx, AVFrame *dst_frame,
+ int *got_frame, AVPacket *avpkt)
{
PNGDecContext *const s = avctx->priv_data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
- AVFrame *dst_frame = data;
AVFrame *p = s->picture.f;
int64_t sig;
int ret;
@@ -1576,12 +1574,10 @@ the_end:
#endif
#if CONFIG_APNG_DECODER
-static int decode_frame_apng(AVCodecContext *avctx,
- void *data, int *got_frame,
- AVPacket *avpkt)
+static int decode_frame_apng(AVCodecContext *avctx, AVFrame *dst_frame,
+ int *got_frame, AVPacket *avpkt)
{
PNGDecContext *const s = avctx->priv_data;
- AVFrame *dst_frame = data;
int ret;
AVFrame *p = s->picture.f;