summaryrefslogtreecommitdiff
path: root/libavcodec/libzvbi-teletextdec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-03-30 19:52:41 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-04-05 19:53:27 +0200
commitfb59a42ef977dd91085a602f10c9c82f88d072e5 (patch)
treee65c7b1e66eb0b07dbe51124e88fb3b918129b6f /libavcodec/libzvbi-teletextdec.c
parent1c3c29d07d7e0b7f5bec13cb0214f90e26604aee (diff)
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/libzvbi-teletextdec.c')
-rw-r--r--libavcodec/libzvbi-teletextdec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/libzvbi-teletextdec.c b/libavcodec/libzvbi-teletextdec.c
index 5ebf47f796..4920c61e0f 100644
--- a/libavcodec/libzvbi-teletextdec.c
+++ b/libavcodec/libzvbi-teletextdec.c
@@ -637,10 +637,10 @@ static int slice_to_vbi_lines(TeletextContext *ctx, uint8_t* buf, int size)
return lines;
}
-static int teletext_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, AVPacket *pkt)
+static int teletext_decode_frame(AVCodecContext *avctx, AVSubtitle *sub,
+ int *got_sub_ptr, AVPacket *pkt)
{
TeletextContext *ctx = avctx->priv_data;
- AVSubtitle *sub = data;
int ret = 0;
if (!ctx->vbi) {
@@ -822,6 +822,6 @@ const FFCodec ff_libzvbi_teletext_decoder = {
.priv_data_size = sizeof(TeletextContext),
.init = teletext_init_decoder,
.close = teletext_close_decoder,
- .decode = teletext_decode_frame,
+ .decode_sub = teletext_decode_frame,
.flush = teletext_flush,
};