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/ccaption_dec.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/ccaption_dec.c')
-rw-r--r-- | libavcodec/ccaption_dec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c index 371c8d18b7..32ee3a715d 100644 --- a/libavcodec/ccaption_dec.c +++ b/libavcodec/ccaption_dec.c @@ -838,10 +838,10 @@ static int process_cc608(CCaptionSubContext *ctx, uint8_t hi, uint8_t lo) return ret; } -static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt) +static int decode(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub, AVPacket *avpkt) { CCaptionSubContext *ctx = avctx->priv_data; - AVSubtitle *sub = data; int64_t in_time = sub->pts; int64_t start_time; int64_t end_time; @@ -955,6 +955,6 @@ const FFCodec ff_ccaption_decoder = { .init = init_decoder, .close = close_decoder, .flush = flush_decoder, - .decode = decode, + .decode_sub = decode, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; |