diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-08-18 16:41:24 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-09-17 15:48:20 +0200 |
commit | 466b39efaf09adecc7314eaba5904b0ee8442528 (patch) | |
tree | aeb8839317065d0df14454019d13f96ad77f1d92 /libavcodec/xsubenc.c | |
parent | 9f64c8219ada4bd48927abaa5eebd7ff9ba95f61 (diff) | |
download | ffmpeg-466b39efaf09adecc7314eaba5904b0ee8442528.tar.gz |
lavc: replace AVCodecContext.encode with subtitle-specific callback
AVCodecContext.encode is currently used only for subtitles, encode2 is
used for audio and video.
Diffstat (limited to 'libavcodec/xsubenc.c')
-rw-r--r-- | libavcodec/xsubenc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/xsubenc.c b/libavcodec/xsubenc.c index ff3b495a03..6f359a1d6e 100644 --- a/libavcodec/xsubenc.c +++ b/libavcodec/xsubenc.c @@ -111,9 +111,8 @@ static int make_tc(uint64_t ms, int *tc) } static int xsub_encode(AVCodecContext *avctx, unsigned char *buf, - int bufsize, void *data) + int bufsize, const AVSubtitle *h) { - AVSubtitle *h = data; uint64_t startTime = h->pts / 1000; // FIXME: need better solution... uint64_t endTime = startTime + h->end_display_time - h->start_display_time; int start_tc[4], end_tc[4]; @@ -215,6 +214,6 @@ AVCodec ff_xsub_encoder = { .type = AVMEDIA_TYPE_SUBTITLE, .id = AV_CODEC_ID_XSUB, .init = xsub_encoder_init, - .encode = xsub_encode, + .encode_sub= xsub_encode, .long_name = NULL_IF_CONFIG_SMALL("DivX subtitles (XSUB)"), }; |