]> git.sesse.net Git - vlc/commitdiff
* In case we do scaling on SSA subs, we also need to adjust the canvas size in which...
authorDerk-Jan Hartman <hartman@videolan.org>
Sat, 25 Mar 2006 23:21:31 +0000 (23:21 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Sat, 25 Mar 2006 23:21:31 +0000 (23:21 +0000)
src/video_output/vout_subpictures.c

index 5cb8cf8fcd89321c1f8187bb83dbee8671156e55..e0f1dd03dd9d4fec4125b10ae7d2665882d635d0 100644 (file)
@@ -504,10 +504,10 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
 
             p_spu->p_text->fmt_out.video.i_width =
                 p_spu->p_text->fmt_out.video.i_visible_width =
-                    p_fmt->i_width;
+                p_fmt->i_width;
             p_spu->p_text->fmt_out.video.i_height =
                 p_spu->p_text->fmt_out.video.i_visible_height =
-                    p_fmt->i_height;
+                p_fmt->i_height;
 
             p_spu->p_text->pf_sub_buffer_new = spu_new_buffer;
             p_spu->p_text->pf_sub_buffer_del = spu_del_buffer;
@@ -516,12 +516,25 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
         }
         else if( p_region )
         {
-            p_spu->p_text->fmt_out.video.i_width =
-                p_spu->p_text->fmt_out.video.i_visible_width =
+            if( p_subpic->i_original_picture_height > 0 &&
+                p_subpic->i_original_picture_width  > 0 )
+            {
+                p_spu->p_text->fmt_out.video.i_width =
+                    p_spu->p_text->fmt_out.video.i_visible_width =
+                    p_subpic->i_original_picture_width;
+                p_spu->p_text->fmt_out.video.i_height =
+                    p_spu->p_text->fmt_out.video.i_visible_height =
+                    p_subpic->i_original_picture_height;
+            }
+            else
+            {
+                p_spu->p_text->fmt_out.video.i_width =
+                    p_spu->p_text->fmt_out.video.i_visible_width =
                     p_fmt->i_width;
-            p_spu->p_text->fmt_out.video.i_height =
-                p_spu->p_text->fmt_out.video.i_visible_height =
+                p_spu->p_text->fmt_out.video.i_height =
+                    p_spu->p_text->fmt_out.video.i_visible_height =
                     p_fmt->i_height;
+            }
         }
 
         i_scale_width = i_scale_width_orig;