Commit 7a15e9a7 authored by Laurent Aimar's avatar Laurent Aimar

Fixed support of crop coming from the decoder.

parent edaffcc8
...@@ -1229,24 +1229,17 @@ static vout_display_t *DisplayNew(vout_thread_t *vout, ...@@ -1229,24 +1229,17 @@ static vout_display_t *DisplayNew(vout_thread_t *vout,
osys->event.fifo = NULL; osys->event.fifo = NULL;
osys->source = *source_org; osys->source = *source_org;
osys->crop.x = source_org->i_x_offset;
video_format_t source = *source_org; osys->crop.y = source_org->i_y_offset;
osys->crop.width = source_org->i_visible_width;
source.i_x_offset = osys->crop.height = source_org->i_visible_height;
osys->crop.x = 0;
source.i_y_offset =
osys->crop.y = 0;
source.i_visible_width =
osys->crop.width = source.i_width;
source.i_visible_height =
osys->crop.height = source.i_height;
osys->crop_saved.num = 0; osys->crop_saved.num = 0;
osys->crop_saved.den = 0; osys->crop_saved.den = 0;
osys->crop.num = 0; osys->crop.num = 0;
osys->crop.den = 0; osys->crop.den = 0;
osys->sar.num = osys->sar_initial.num ? osys->sar_initial.num : source.i_sar_num; 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.i_sar_den; osys->sar.den = osys->sar_initial.den ? osys->sar_initial.den : source_org->i_sar_den;
#ifdef ALLOW_DUMMY_VOUT #ifdef ALLOW_DUMMY_VOUT
vlc_mouse_Init(&osys->vout_mouse); vlc_mouse_Init(&osys->vout_mouse);
#endif #endif
...@@ -1262,6 +1255,13 @@ static vout_display_t *DisplayNew(vout_thread_t *vout, ...@@ -1262,6 +1255,13 @@ static vout_display_t *DisplayNew(vout_thread_t *vout,
owner.sys = osys; owner.sys = osys;
/* */ /* */
video_format_t source = *source_org;
source.i_x_offset = 0;
source.i_y_offset = 0;
source.i_visible_width = source.i_width;
source.i_visible_height = source.i_height;
vout_display_t *p_display = vout_display_New(VLC_OBJECT(vout), vout_display_t *p_display = vout_display_New(VLC_OBJECT(vout),
module, !is_wrapper, module, !is_wrapper,
&source, cfg, &owner); &source, cfg, &owner);
...@@ -1273,15 +1273,15 @@ static vout_display_t *DisplayNew(vout_thread_t *vout, ...@@ -1273,15 +1273,15 @@ static vout_display_t *DisplayNew(vout_thread_t *vout,
VoutDisplayCreateRender(p_display); VoutDisplayCreateRender(p_display);
/* Setup delayed request */ /* Setup delayed request */
if (osys->sar.num != source_org->i_sar_num || if (osys->sar.num != source.i_sar_num ||
osys->sar.den != source_org->i_sar_den) osys->sar.den != source.i_sar_den)
osys->ch_sar = true; osys->ch_sar = true;
if (osys->wm_state != osys->wm_state_initial) if (osys->wm_state != osys->wm_state_initial)
osys->ch_wm_state = true; osys->ch_wm_state = true;
if (osys->crop.x != source_org->i_x_offset || if (osys->crop.x != source.i_x_offset ||
osys->crop.y != source_org->i_y_offset || osys->crop.y != source.i_y_offset ||
osys->crop.width != source_org->i_visible_width || osys->crop.width != source.i_visible_width ||
osys->crop.height != source_org->i_visible_height) osys->crop.height != source.i_visible_height)
osys->ch_crop = true; osys->ch_crop = true;
return p_display; return p_display;
......
...@@ -57,20 +57,14 @@ int vout_OpenWrapper(vout_thread_t *vout, ...@@ -57,20 +57,14 @@ int vout_OpenWrapper(vout_thread_t *vout,
sys->display.title = var_CreateGetNonEmptyString(vout, "video-title"); sys->display.title = var_CreateGetNonEmptyString(vout, "video-title");
/* */ /* */
video_format_t source = vout->p->original;
source.i_visible_width = source.i_width;
source.i_visible_height = source.i_height;
source.i_x_offset = 0;
source.i_y_offset = 0;
const mtime_t double_click_timeout = 300000; const mtime_t double_click_timeout = 300000;
const mtime_t hide_timeout = var_CreateGetInteger(vout, "mouse-hide-timeout") * 1000; const mtime_t hide_timeout = var_CreateGetInteger(vout, "mouse-hide-timeout") * 1000;
if (splitter_name) { if (splitter_name) {
sys->display.vd = vout_NewSplitter(vout, &source, state, "$vout", splitter_name, sys->display.vd = vout_NewSplitter(vout, &vout->p->original, state, "$vout", splitter_name,
double_click_timeout, hide_timeout); double_click_timeout, hide_timeout);
} else { } else {
sys->display.vd = vout_NewDisplay(vout, &source, state, "$vout", sys->display.vd = vout_NewDisplay(vout, &vout->p->original, state, "$vout",
double_click_timeout, hide_timeout); double_click_timeout, hide_timeout);
} }
if (!sys->display.vd) { if (!sys->display.vd) {
......
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