mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 18:40:03 +01:00
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>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user