[FFmpeg-cvslog] libavcodec/xsubenc.c: Fix bounding box coordinates

Erik Olofsson git at videolan.org
Tue Nov 12 03:16:39 CET 2013


ffmpeg | branch: master | Erik Olofsson <eaj.olofsson at gmail.com> | Thu Nov  7 21:07:10 2013 +0100| [3b1dcdec7d85f25b39fc90aed026419d394b78a5] | committer: Michael Niedermayer

libavcodec/xsubenc.c: Fix bounding box coordinates

Fix coordinates of the lower right corner of the text area.
Note that the coordinates are redundant as the size and
position of the text area are known.
Many decoders (including Sony Playstation 3, VLC and FFmpeg)
ignore the redundant coordinates.
Some hardware decoders need them for correct playback.

Verified on Philips DVD player models HTS7201 and DVP3380.

Fixes ticket #3031

Signed-off-by: Erik Olofsson <eaj.olofsson at gmail.com>
Reviewed-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3b1dcdec7d85f25b39fc90aed026419d394b78a5
---

 libavcodec/xsubenc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/xsubenc.c b/libavcodec/xsubenc.c
index 9dc80ee..bb2cdb0 100644
--- a/libavcodec/xsubenc.c
+++ b/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;



More information about the ffmpeg-cvslog mailing list