X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fxsubenc.c;h=816e651a67f590d13c9836328a7192ed212e67fc;hb=3d8c80b611aa1e2f800dd9c8d8f350407f95c042;hp=0c7d07f09d046074032443b097ff14a431f20d1c;hpb=adbfc605f6bbe87b292c82cd1f5d4d974fa6b73c;p=ffmpeg diff --git a/libavcodec/xsubenc.c b/libavcodec/xsubenc.c index 0c7d07f09d0..816e651a67f 100644 --- a/libavcodec/xsubenc.c +++ b/libavcodec/xsubenc.c @@ -90,7 +90,7 @@ static int xsub_encode_rle(PutBitContext *pb, const uint8_t *bitmap, if (color != PADDING_COLOR && (PADDING + (w&1))) put_xsub_rle(pb, PADDING + (w&1), PADDING_COLOR); - align_put_bits(pb); + avpriv_align_put_bits(pb); bitmap += linesize; } @@ -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]; @@ -194,7 +193,7 @@ static int xsub_encode(AVCodecContext *avctx, unsigned char *buf, // Enforce total height to be be multiple of 2 if (h->rects[0]->h & 1) { put_xsub_rle(&pb, h->rects[0]->w, PADDING_COLOR); - align_put_bits(&pb); + avpriv_align_put_bits(&pb); } flush_put_bits(&pb); @@ -211,12 +210,10 @@ static av_cold int xsub_encoder_init(AVCodecContext *avctx) } AVCodec ff_xsub_encoder = { - "xsub", - AVMEDIA_TYPE_SUBTITLE, - CODEC_ID_XSUB, - 0, - xsub_encoder_init, - xsub_encode, - NULL, - .long_name = NULL_IF_CONFIG_SMALL("DivX subtitles (XSUB)"), + .name = "xsub", + .type = AVMEDIA_TYPE_SUBTITLE, + .id = AV_CODEC_ID_XSUB, + .init = xsub_encoder_init, + .encode_sub = xsub_encode, + .long_name = NULL_IF_CONFIG_SMALL("DivX subtitles (XSUB)"), };