diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-03-30 19:52:41 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-04-05 19:53:27 +0200 |
commit | fb59a42ef977dd91085a602f10c9c82f88d072e5 (patch) | |
tree | e65c7b1e66eb0b07dbe51124e88fb3b918129b6f /libavcodec/decode.c | |
parent | 1c3c29d07d7e0b7f5bec13cb0214f90e26604aee (diff) | |
download | ffmpeg-fb59a42ef977dd91085a602f10c9c82f88d072e5.tar.gz |
avcodec/codec_internal: Add FFCodec.decode_sub
This increases type-safety by avoiding conversions from/through void*.
It also avoids the boilerplate "AVSubtitle *sub = data;" line
for subtitle decoders. Its only downside is that it increases
sizeof(FFCodec), yet this can be more than offset lateron.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/decode.c')
-rw-r--r-- | libavcodec/decode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/decode.c b/libavcodec/decode.c index f9fdb935f6..b5b78b9ca2 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -862,7 +862,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, if (avctx->pkt_timebase.num && avpkt->pts != AV_NOPTS_VALUE) sub->pts = av_rescale_q(avpkt->pts, avctx->pkt_timebase, AV_TIME_BASE_Q); - ret = ffcodec(avctx->codec)->decode(avctx, sub, got_sub_ptr, pkt); + ret = ffcodec(avctx->codec)->decode_sub(avctx, sub, got_sub_ptr, pkt); if (pkt == avci->buffer_pkt) // did we recode? av_packet_unref(avci->buffer_pkt); if (ret < 0) { |