[vlc-devel] commit: Added a is_forced parameter to VOUT_DISPLAY_CHANGE_DISPLAY_SIZE. ( Laurent Aimar )

git version control git at videolan.org
Wed Sep 30 21:26:22 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed Sep 30 21:22:17 2009 +0200| [2663f4bfeca70d84fb2f52f6b42efeec5a519832] | committer: Laurent Aimar 

Added a is_forced parameter to VOUT_DISPLAY_CHANGE_DISPLAY_SIZE.

 It allows to be sure to avoid infinite ping-pong between
VOUT_DISPLAY_CHANGE_DISPLAY_SIZE and VOUT_DISPLAY_EVENT_DISPLAY_SIZE in
some corner cases or broken "vout window".

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

 include/vlc_vout_display.h |    2 +-
 src/video_output/display.c |   15 +++++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 9f97fba..f7c1677 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -138,7 +138,7 @@ enum {
 
     /* Ask the module to acknowledge/refuse the display size change requested
      * (externally or by VOUT_DISPLAY_EVENT_DISPLAY_SIZE) */
-    VOUT_DISPLAY_CHANGE_DISPLAY_SIZE,   /* const vout_display_cfg_t *p_cfg */
+    VOUT_DISPLAY_CHANGE_DISPLAY_SIZE,   /* const vout_display_cfg_t *p_cfg, int is_forced */
 
     /* Ask the module to acknowledge/refuse fill display state change after
      * being requested externally */
diff --git a/src/video_output/display.c b/src/video_output/display.c
index e3a3305..c2c7420 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -353,6 +353,7 @@ struct vout_display_owner_sys_t {
     int  display_width;
     int  display_height;
     bool display_is_fullscreen;
+    bool display_is_forced;
 };
 
 static void VoutDisplayCreateRender(vout_display_t *vd)
@@ -581,6 +582,7 @@ static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args)
         osys->display_width         = width;
         osys->display_height        = height;
         osys->display_is_fullscreen = is_fullscreen;
+        osys->display_is_forced     = false;
 
         vlc_mutex_unlock(&osys->lock);
         break;
@@ -659,6 +661,7 @@ void vout_ManageDisplay(vout_display_t *vd)
         int  display_width         = osys->display_width;
         int  display_height        = osys->display_height;
         bool display_is_fullscreen = osys->display_is_fullscreen;
+        bool display_is_forced     = osys->display_is_forced;
         osys->ch_display_size = false;
 
         bool reset_pictures = osys->reset_pictures;
@@ -701,7 +704,7 @@ void vout_ManageDisplay(vout_display_t *vd)
             cfg.display.height = display_height;
 
             if (!cfg.is_fullscreen != !display_is_fullscreen ||
-                vout_display_Control(vd, VOUT_DISPLAY_CHANGE_DISPLAY_SIZE, &cfg)) {
+                vout_display_Control(vd, VOUT_DISPLAY_CHANGE_DISPLAY_SIZE, &cfg, display_is_forced)) {
                 if (!cfg.is_fullscreen == !display_is_fullscreen)
                     msg_Err(vd, "Failed to resize display");
 
@@ -755,7 +758,15 @@ void vout_ManageDisplay(vout_display_t *vd)
                 const int display_width  = (int64_t)vd->source.i_width  * osys->zoom.num / osys->zoom.den;
                 const int display_height = (int64_t)vd->source.i_height * osys->zoom.num / osys->zoom.den;
 
-                vout_display_SendEventDisplaySize(vd, display_width, display_height, osys->cfg.is_fullscreen);
+                vlc_mutex_lock(&osys->lock);
+
+                osys->ch_display_size       = true;
+                osys->display_width         = display_width;
+                osys->display_height        = display_height;
+                osys->display_is_fullscreen = osys->cfg.is_fullscreen;
+                osys->display_is_forced     = true;
+
+                vlc_mutex_unlock(&osys->lock);
             }
 
             osys->cfg.zoom.num = osys->zoom.num;




More information about the vlc-devel mailing list