[vlc-commits] Improved subtitiles/ OSD quality when the rendering is done by the vout display module.

Laurent Aimar git at videolan.org
Thu Apr 14 23:33:34 CEST 2011


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Apr 14 22:45:34 2011 +0200| [4a49754d943560fe79bc42f107d8ce566ea24898] | committer: Laurent Aimar

Improved subtitiles/OSD quality when the rendering is done by the vout display module.

In this case, the subpictures are rendered either at the display size or
the video size (the biggest one).

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

 src/video_output/video_output.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index cbbd566..ee0a99e 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -918,7 +918,18 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
     const vlc_fourcc_t *subpicture_chromas;
     video_format_t fmt_spu;
     if (do_dr_spu) {
-        fmt_spu = vd->source; /* TODO improve */
+        vout_display_place_t place;
+        vout_display_PlacePicture(&place, &vd->source, vd->cfg, false);
+
+        fmt_spu = vd->source;
+        if (fmt_spu.i_width * fmt_spu.i_height < place.width * place.height) {
+            fmt_spu.i_sar_num = vd->cfg->display.sar.num;
+            fmt_spu.i_sar_den = vd->cfg->display.sar.den;
+            fmt_spu.i_width          =
+            fmt_spu.i_visible_width  = place.width;
+            fmt_spu.i_height         =
+            fmt_spu.i_visible_height = place.height;
+        }
         subpicture_chromas = vd->info.subpicture_chromas;
     } else {
         if (do_early_spu) {



More information about the vlc-commits mailing list