Commit 446593be authored by Vittorio Giovara's avatar Vittorio Giovara Committed by Jean-Baptiste Kempf

core: use same source name in DisplayNew

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 9bff58d3
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment