[vlc-commits] Scale subpictures without AR to fill up the whole display.

Laurent Aimar git at videolan.org
Thu Jan 5 23:19:06 CET 2012


vlc/vlc-1.2 | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Jan  5 21:50:46 2012 +0100| [835a5c0059f869ee6f92b2bfd1d07555d8c78909] | committer: Jean-Baptiste Kempf

Scale subpictures without AR to fill up the whole display.

It closes #5683
(cherry picked from commit 705d11a4de11c5ab20941f36f93589b855a5c3ce)

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

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=835a5c0059f869ee6f92b2bfd1d07555d8c78909
---

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

diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index 70a7008..6434772 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -1042,8 +1042,10 @@ static subpicture_t *SpuRenderSubpictures(spu_t *spu,
             /* Compute region scale AR */
             video_format_t region_fmt = region->fmt;
             if (region_fmt.i_sar_num <= 0 || region_fmt.i_sar_den <= 0) {
-                region_fmt.i_sar_num = fmt_src->i_sar_num;
-                region_fmt.i_sar_den = fmt_src->i_sar_den;
+                region_fmt.i_sar_num = (int64_t)fmt_dst->i_width  * fmt_dst->i_sar_num * subpic->i_original_picture_height;
+                region_fmt.i_sar_den = (int64_t)fmt_dst->i_height * fmt_dst->i_sar_den * subpic->i_original_picture_width;
+                vlc_ureduce(&region_fmt.i_sar_num, &region_fmt.i_sar_den,
+                            region_fmt.i_sar_num, region_fmt.i_sar_den, 65536);
             }
 
             /* Compute scaling from original size to destination size



More information about the vlc-commits mailing list