diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-03-30 22:33:24 +0300 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-04-05 20:54:09 +0300 |
commit | ce7dbd0481f990e249c2a05f179228489d3062cf (patch) | |
tree | c5f04e58129705430e1d97a5842131b72e250083 /libavcodec/vp9.c | |
parent | fb59a42ef977dd91085a602f10c9c82f88d072e5 (diff) |
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/vp9.c')
-rw-r--r-- | libavcodec/vp9.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index 1b822c4592..8f2c52da87 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -1550,7 +1550,7 @@ static int vp9_export_enc_params(VP9Context *s, VP9Frame *frame) return 0; } -static int vp9_decode_frame(AVCodecContext *avctx, void *frame, +static int vp9_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt) { const uint8_t *data = pkt->data; @@ -1570,8 +1570,8 @@ static int vp9_decode_frame(AVCodecContext *avctx, void *frame, } if ((ret = av_frame_ref(frame, s->s.refs[ref].f)) < 0) return ret; - ((AVFrame *)frame)->pts = pkt->pts; - ((AVFrame *)frame)->pkt_dts = pkt->dts; + frame->pts = pkt->pts; + frame->pkt_dts = pkt->dts; for (i = 0; i < 8; i++) { if (s->next_refs[i].f->buf[0]) ff_thread_release_ext_buffer(avctx, &s->next_refs[i]); |