[vlc-commits] commit: Fixed segfault with some OSD. (Laurent Aimar )

git at videolan.org git at videolan.org
Tue May 11 00:34:33 CEST 2010


vlc/vlc-1.1 | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon May 10 23:01:37 2010 +0200| [bf445d22bfb0bb2557f1ed3e6270b79439415a1a] | committer: Jean-Baptiste Kempf 

Fixed segfault with some OSD.
(cherry picked from commit b501789db33724b832ebc09348fefe4d3b42e5b4)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=bf445d22bfb0bb2557f1ed3e6270b79439415a1a
---

 src/video_output/vout_subpictures.c |   28 ++++------------------------
 1 files changed, 4 insertions(+), 24 deletions(-)

diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index 68b1052..f959a4e 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -1302,25 +1302,6 @@ static void SpuRegionPlace( int *pi_x, int *pi_y,
         i_y = i_delta_y;
     }
 
-    /* Margin shifts all subpictures */
-    /* NOTE We have margin only for subtitles, so we don't really need this here
-    if( i_margin_y != 0 )
-        i_y -= i_margin_y;*/
-
-    /* Clamp offset to not go out of the screen (when possible) */
-    /* NOTE Again, useful only for subtitles, otherwise goes against the alignment logic above
-    const int i_error_x = (i_x + p_region->fmt.i_width) - p_subpic->i_original_picture_width;
-    if( i_error_x > 0 )
-        i_x -= i_error_x;
-    if( i_x < 0 )
-        i_x = 0;
-
-    const int i_error_y = (i_y + p_region->fmt.i_height) - p_subpic->i_original_picture_height;
-    if( i_error_y > 0 )
-        i_y -= i_error_y;
-    if( i_y < 0 )
-        i_y = 0;*/
-
     *pi_x = i_x;
     *pi_y = i_y;
 }
@@ -1427,12 +1408,11 @@ static void SpuRenderRegion( spu_t *p_spu,
 
     /* apply margin to subtitles and correct if they go over the picture edge */
     if( p_subpic->b_subtitle )
-    {
         restrained.i_y -= i_margin_y;
-        spu_area_t display = spu_area_create( 0, 0, p_fmt->i_width, p_fmt->i_height,
-                                              spu_scale_unit() );
-        SpuAreaFitInside( &restrained, &display );
-    }
+
+    spu_area_t display = spu_area_create( 0, 0, p_fmt->i_width, p_fmt->i_height,
+                                          spu_scale_unit() );
+    SpuAreaFitInside( &restrained, &display );
 
     /* Fix the position for the current scale_size */
     i_x_offset = spu_scale_w( restrained.i_x, restrained.scale );



More information about the vlc-commits mailing list