[vlc-commits] core: use same source name in DisplayNew

Vittorio Giovara git at videolan.org
Sun Dec 8 13:48:34 CET 2013


vlc | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Wed Nov 27 09:23:39 2013 +0100| [446593be8934f5cf9590ecd1a796b80f98ce765b] | committer: Jean-Baptiste Kempf

core: use same source name in DisplayNew

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

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

 src/video_output/display.c |   26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/src/video_output/display.c b/src/video_output/display.c
index 2cc0e06..b268c18 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -1216,7 +1216,7 @@ struct vlc_gl_t *vout_GetDisplayOpengl(vout_display_t *vd)
 }
 
 static vout_display_t *DisplayNew(vout_thread_t *vout,
-                                  const video_format_t *source_org,
+                                  const video_format_t *source,
                                   const vout_display_state_t *state,
                                   const char *module,
                                   bool is_wrapper, vout_display_t *wrapper,
@@ -1233,7 +1233,7 @@ static vout_display_t *DisplayNew(vout_thread_t *vout,
     osys->sar_initial.num = state->sar.num;
     osys->sar_initial.den = state->sar.den;
     vout_display_GetDefaultDisplaySize(&cfg->display.width, &cfg->display.height,
-                                       source_org, cfg);
+                                       source, cfg);
 
     osys->vout = vout;
     osys->is_wrapper = is_wrapper;
@@ -1258,7 +1258,7 @@ static vout_display_t *DisplayNew(vout_thread_t *vout,
         cfg_windowed.display.height = 0;
         vout_display_GetDefaultDisplaySize(&osys->width_saved,
                                            &osys->height_saved,
-                                           source_org, &cfg_windowed);
+                                           source, &cfg_windowed);
     }
     osys->zoom.num = cfg->zoom.num;
     osys->zoom.den = cfg->zoom.den;
@@ -1266,7 +1266,7 @@ static vout_display_t *DisplayNew(vout_thread_t *vout,
     osys->fit_window = 0;
     osys->event.fifo = NULL;
 
-    osys->source = *source_org;
+    osys->source = *source;
     osys->crop.left   = 0;
     osys->crop.top    = 0;
     osys->crop.right  = 0;
@@ -1276,8 +1276,8 @@ static vout_display_t *DisplayNew(vout_thread_t *vout,
     osys->crop.num = 0;
     osys->crop.den = 0;
 
-    osys->sar.num = osys->sar_initial.num ? osys->sar_initial.num : source_org->i_sar_num;
-    osys->sar.den = osys->sar_initial.den ? osys->sar_initial.den : source_org->i_sar_den;
+    osys->sar.num = osys->sar_initial.num ? osys->sar_initial.num : source->i_sar_num;
+    osys->sar.den = osys->sar_initial.den ? osys->sar_initial.den : source->i_sar_den;
 #ifdef ALLOW_DUMMY_VOUT
     vlc_mouse_Init(&osys->vout_mouse);
 #endif
@@ -1292,12 +1292,9 @@ static vout_display_t *DisplayNew(vout_thread_t *vout,
     }
     owner.sys = osys;
 
-    /* keep a reference to the source before display */
-    video_format_t source = *source_org;
-
     vout_display_t *p_display = vout_display_New(VLC_OBJECT(vout),
                                                  module, !is_wrapper,
-                                                 &source, cfg, &owner);
+                                                 source, cfg, &owner);
     if (!p_display) {
         free(osys);
         return NULL;
@@ -1306,16 +1303,11 @@ static vout_display_t *DisplayNew(vout_thread_t *vout,
     VoutDisplayCreateRender(p_display);
 
     /* Setup delayed request */
-    if (osys->sar.num != source.i_sar_num ||
-        osys->sar.den != source.i_sar_den)
+    if (osys->sar.num != source->i_sar_num ||
+        osys->sar.den != source->i_sar_den)
         osys->ch_sar = true;
     if (osys->wm_state != osys->wm_state_initial)
         osys->ch_wm_state = true;
-    if (source.i_x_offset       != source_org->i_x_offset ||
-        source.i_y_offset       != source_org->i_y_offset ||
-        source.i_visible_width  != source_org->i_visible_width ||
-        source.i_visible_height != source_org->i_visible_height)
-        osys->ch_crop = true;
 
     return p_display;
 }



More information about the vlc-commits mailing list