[vlc-commits] libass: use the visible area dimensions, not the input dimensions

Steve Lhomme git at videolan.org
Wed Mar 25 15:17:50 CET 2015


vlc/vlc-2.2 | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Fri Mar 20 08:07:05 2015 +0000| [07022abd1d595cec60bff259f7c0de5625a18445] | committer: Jean-Baptiste Kempf

libass: use the visible area dimensions, not the input dimensions

Fixes incorrect offset when playing http://streams.videolan.org/misc/test-files-ccc/vsfilter_general_TestCase.mkv

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 3f106f42be8e7d5b66b74b0c6cf96a6f513eec90)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=07022abd1d595cec60bff259f7c0de5625a18445
---

 modules/codec/libass.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/modules/codec/libass.c b/modules/codec/libass.c
index dc247f4..8e32d64 100644
--- a/modules/codec/libass.c
+++ b/modules/codec/libass.c
@@ -394,15 +394,13 @@ static int SubpictureValidate( subpicture_t *p_subpic,
     video_format_t fmt = *p_fmt_dst;
     fmt.i_chroma         = VLC_CODEC_RGBA;
     fmt.i_bits_per_pixel = 0;
-    fmt.i_visible_width  = fmt.i_width;
-    fmt.i_visible_height = fmt.i_height;
     fmt.i_x_offset       = 0;
     fmt.i_y_offset       = 0;
     if( b_fmt_src || b_fmt_dst )
     {
-        ass_set_frame_size( p_sys->p_renderer, fmt.i_width, fmt.i_height );
-        const double src_ratio = (double)p_fmt_src->i_width / p_fmt_src->i_height;
-        const double dst_ratio = (double)p_fmt_dst->i_width / p_fmt_dst->i_height;
+        ass_set_frame_size( p_sys->p_renderer, fmt.i_visible_width, fmt.i_visible_height );
+        const double src_ratio = (double)p_fmt_src->i_visible_width / p_fmt_src->i_visible_height;
+        const double dst_ratio = (double)p_fmt_dst->i_visible_width / p_fmt_dst->i_visible_height;
         ass_set_aspect_ratio( p_sys->p_renderer, dst_ratio / src_ratio, 1 );
         p_sys->fmt = fmt;
     }
@@ -438,8 +436,8 @@ static void SubpictureUpdate( subpicture_t *p_subpic,
     ASS_Image *p_img = p_subpic->updater.p_sys->p_img;
 
     /* */
-    p_subpic->i_original_picture_height = fmt.i_height;
-    p_subpic->i_original_picture_width = fmt.i_width;
+    p_subpic->i_original_picture_height = fmt.i_visible_height;
+    p_subpic->i_original_picture_width = fmt.i_visible_width;
 
     /* XXX to improve efficiency we merge regions that are close minimizing
      * the lost surface.



More information about the vlc-commits mailing list