summaryrefslogtreecommitdiff
path: root/libavcodec/diracdec.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/diracdec.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/diracdec.c')
-rw-r--r--libavcodec/diracdec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 12f97feb6b..e13b6b6e10 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -2260,10 +2260,10 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
return 0;
}
-static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt)
+static int dirac_decode_frame(AVCodecContext *avctx, AVFrame *picture,
+ int *got_frame, AVPacket *pkt)
{
DiracContext *s = avctx->priv_data;
- AVFrame *picture = data;
uint8_t *buf = pkt->data;
int buf_size = pkt->size;
int i, buf_idx = 0;
@@ -2282,7 +2282,7 @@ static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
/* end of stream, so flush delayed pics */
if (buf_size == 0)
- return get_delayed_pic(s, (AVFrame *)data, got_frame);
+ return get_delayed_pic(s, picture, got_frame);
for (;;) {
/*[DIRAC_STD] Here starts the code from parse_info() defined in 9.6
@@ -2339,13 +2339,13 @@ static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (delayed_frame) {
delayed_frame->reference ^= DELAYED_PIC_REF;
- if((ret=av_frame_ref(data, delayed_frame->avframe)) < 0)
+ if((ret = av_frame_ref(picture, delayed_frame->avframe)) < 0)
return ret;
*got_frame = 1;
}
} else if (s->current_picture->avframe->display_picture_number == s->frame_number) {
/* The right frame at the right time :-) */
- if((ret=av_frame_ref(data, s->current_picture->avframe)) < 0)
+ if((ret = av_frame_ref(picture, s->current_picture->avframe)) < 0)
return ret;
*got_frame = 1;
}