diff options
Diffstat (limited to 'ffmpeg/libavcodec/xsubenc.c')
| -rw-r--r-- | ffmpeg/libavcodec/xsubenc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ffmpeg/libavcodec/xsubenc.c b/ffmpeg/libavcodec/xsubenc.c index cb2a908..53f4d6c 100644 --- a/ffmpeg/libavcodec/xsubenc.c +++ b/ffmpeg/libavcodec/xsubenc.c @@ -166,8 +166,8 @@ static int xsub_encode(AVCodecContext *avctx, unsigned char *buf, bytestream_put_le16(&hdr, height); bytestream_put_le16(&hdr, h->rects[0]->x); bytestream_put_le16(&hdr, h->rects[0]->y); - bytestream_put_le16(&hdr, h->rects[0]->x + width); - bytestream_put_le16(&hdr, h->rects[0]->y + height); + bytestream_put_le16(&hdr, h->rects[0]->x + width -1); + bytestream_put_le16(&hdr, h->rects[0]->y + height -1); rlelenptr = hdr; // Will store length of first field here later. hdr+=2; @@ -190,7 +190,7 @@ static int xsub_encode(AVCodecContext *avctx, unsigned char *buf, h->rects[0]->w, h->rects[0]->h >> 1)) return -1; - // Enforce total height to be be multiple of 2 + // Enforce total height to be a multiple of 2 if (h->rects[0]->h & 1) { put_xsub_rle(&pb, h->rects[0]->w, PADDING_COLOR); avpriv_align_put_bits(&pb); @@ -206,14 +206,16 @@ static av_cold int xsub_encoder_init(AVCodecContext *avctx) if (!avctx->codec_tag) avctx->codec_tag = MKTAG('D','X','S','B'); + avctx->bits_per_coded_sample = 4; + return 0; } AVCodec ff_xsub_encoder = { .name = "xsub", + .long_name = NULL_IF_CONFIG_SMALL("DivX subtitles (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)"), }; |
