X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_filter%2Fwall.c;h=258b50a0a7796bccd9db8b394badde65d57678ad;hb=a2c139d5c1217448bd4c698a96fd0431084b7875;hp=8ebc34c3b9804b3c90df102c0a958a0fb6069b04;hpb=ba9826cacf6f17a741a88e9346a6cd674d7f0e29;p=vlc diff --git a/modules/video_filter/wall.c b/modules/video_filter/wall.c index 8ebc34c3b9..258b50a0a7 100644 --- a/modules/video_filter/wall.c +++ b/modules/video_filter/wall.c @@ -229,6 +229,7 @@ static int Init( vout_thread_t *p_vout ) int i_index, i_row, i_col, i_width, i_height, i_left, i_top; unsigned int i_target_width,i_target_height; picture_t *p_pic; + video_format_t fmt = {0}; int i_aspect = 4*VOUT_ASPECT_FACTOR/3; int i_align = 0; unsigned int i_hstart, i_hend, i_vstart, i_vend; @@ -269,6 +270,14 @@ static int Init( vout_thread_t *p_vout ) p_vout->output.i_aspect = p_vout->render.i_aspect; var_Create( p_vout, "align", VLC_VAR_INTEGER ); + fmt.i_width = fmt.i_visible_width = p_vout->render.i_width; + fmt.i_height = fmt.i_visible_height = p_vout->render.i_height; + fmt.i_x_offset = fmt.i_y_offset = 0; + fmt.i_chroma = p_vout->render.i_chroma; + fmt.i_aspect = p_vout->render.i_aspect; + fmt.i_sar_num = p_vout->render.i_aspect * fmt.i_height / fmt.i_width; + fmt.i_sar_den = VOUT_ASPECT_FACTOR; + w1 = p_vout->output.i_width / p_vout->p_sys->i_col; w1 &= ~1; h1 = w1 * VOUT_ASPECT_FACTOR / i_aspect&~1; @@ -339,7 +348,7 @@ static int Init( vout_thread_t *p_vout ) else { i_width = ( i_target_width - i_hstart % i_target_width ); - if( i_col > ( p_vout->p_sys->i_col / 2 ) ) + if( i_col >= ( p_vout->p_sys->i_col / 2 ) ) { i_align |= VOUT_ALIGN_LEFT; i_width -= i_hstart_rounded ? 2: 0; @@ -364,7 +373,7 @@ static int Init( vout_thread_t *p_vout ) { i_height = ( i_target_height - i_vstart%i_target_height ); - if( i_row > ( p_vout->p_sys->i_row / 2 ) ) + if( i_row >= ( p_vout->p_sys->i_row / 2 ) ) { i_align |= VOUT_ALIGN_TOP; i_height -= i_vstart_rounded ? 2: 0; @@ -394,12 +403,14 @@ static int Init( vout_thread_t *p_vout ) var_SetInteger( p_vout, "video-x", i_left + i_xpos - i_width); var_SetInteger( p_vout, "video-y", i_top + i_ypos ); + fmt.i_width = fmt.i_visible_width = i_width; + fmt.i_height = fmt.i_visible_height = i_height; + fmt.i_aspect = i_aspect * i_target_height / i_height * + i_width / i_target_width; + p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout = - vout_Create( p_vout, i_width, i_height, - p_vout->render.i_chroma, - i_aspect * i_target_height / i_height * - i_width / i_target_width ); - if( p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout == NULL ) + vout_Create( p_vout, &fmt ); + if( !p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout ) { msg_Err( p_vout, "failed to get %ix%i vout threads", p_vout->p_sys->i_col, p_vout->p_sys->i_row );