[vlc-commits] display: no need for a local video_format_t with VOUT_DISPLAY_CHANGE_SOURCE_ASPECT

Steve Lhomme git at videolan.org
Fri Aug 4 17:57:22 CEST 2017


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Wed Aug  2 09:33:35 2017 +0200| [141eee707daf6096b339d649771612a52a1ee043] | committer: Rémi Denis-Courmont

display: no need for a local video_format_t with VOUT_DISPLAY_CHANGE_SOURCE_ASPECT

Receivers don't check the difference with the original value, they just apply
the new value.

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 src/video_output/display.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/video_output/display.c b/src/video_output/display.c
index 220ae3866b..a41e6cf62c 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -945,30 +945,31 @@ bool vout_ManageDisplay(vout_display_t *vd, bool allow_reset_pictures)
 #endif
         /* */
         if (osys->ch_sar) {
-            video_format_t source = vd->source;
+            unsigned int i_sar_num = vd->source.i_sar_num;
+            unsigned int i_sar_den = vd->source.i_sar_den;
 
             if (osys->sar.num > 0 && osys->sar.den > 0) {
-                source.i_sar_num = osys->sar.num;
-                source.i_sar_den = osys->sar.den;
+                vd->source.i_sar_num = osys->sar.num;
+                vd->source.i_sar_den = osys->sar.den;
             } else {
-                source.i_sar_num = osys->source.i_sar_num;
-                source.i_sar_den = osys->source.i_sar_den;
+                vd->source.i_sar_num = osys->source.i_sar_num;
+                vd->source.i_sar_den = osys->source.i_sar_den;
             }
 
-            if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_SOURCE_ASPECT, &source)) {
+            if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_SOURCE_ASPECT, &vd->source)) {
                 /* There nothing much we can do. The only reason a vout display
                  * does not support it is because it need the core to add black border
                  * to the video for it.
                  * TODO add black borders ?
                  */
                 msg_Err(vd, "Failed to change source AR");
-                source = vd->source;
+                vd->source.i_sar_num = i_sar_num;
+                vd->source.i_sar_den = i_sar_den;
             } else if (!osys->fit_window) {
                 osys->fit_window = 1;
             }
-            vd->source = source;
-            osys->sar.num = source.i_sar_num;
-            osys->sar.den = source.i_sar_den;
+            osys->sar.num = vd->source.i_sar_num;
+            osys->sar.den = vd->source.i_sar_den;
             osys->ch_sar  = false;
 
             /* If a crop ratio is requested, recompute the parameters */



More information about the vlc-commits mailing list