X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fgui%2Fmacosx%2Fvoutqt.m;fp=modules%2Fgui%2Fmacosx%2Fvoutqt.m;h=70fd8f8c9acafc4606cf626ce6a20f23cc66dcb8;hb=ac1de0c780b0ee148857bfce66ff65267c635088;hp=55e387130b0a750390e7ba70e8b5da31da61b5c5;hpb=00788d2df9f3dea1194bfde97439f1a8aa22ad3e;p=vlc diff --git a/modules/gui/macosx/voutqt.m b/modules/gui/macosx/voutqt.m index 55e387130b..70fd8f8c9a 100644 --- a/modules/gui/macosx/voutqt.m +++ b/modules/gui/macosx/voutqt.m @@ -9,6 +9,7 @@ * Jon Lech Johansen * Derk-Jan Hartman * Eric Petit + * Benjamin Pracht * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -81,7 +82,7 @@ struct picture_sys_t { void *p_data; unsigned int i_size; - + /* When using I420 output */ PlanarPixmapInfoYUV420 pixmap_i420; }; @@ -378,14 +379,21 @@ static int ManageVideo( vout_thread_t *p_vout ) p_vout->i_changes |= VOUT_SIZE_CHANGE; } - if( p_vout->i_changes & VOUT_SIZE_CHANGE ) + if( p_vout->i_changes & VOUT_SIZE_CHANGE || + p_vout->i_changes & VOUT_ASPECT_CHANGE ) { QTScaleMatrix( p_vout ); SetDSequenceMatrix( p_vout->p_sys->i_seq, p_vout->p_sys->p_matrix ); + } + if( p_vout->i_changes & VOUT_SIZE_CHANGE ) + { p_vout->i_changes &= ~VOUT_SIZE_CHANGE; } - + if( p_vout->i_changes & VOUT_ASPECT_CHANGE ) + { + p_vout->i_changes &= ~VOUT_ASPECT_CHANGE; + } [p_vout->p_sys->o_vout_view manage]; return( 0 ); @@ -525,8 +533,8 @@ static int CoToggleFullscreen( vout_thread_t *p_vout ) if( QTCreateSequence( p_vout ) ) { msg_Err( p_vout, "unable to initialize QT: QTCreateSequence failed" ); - return( 1 ); - } + return( 1 ); + } [o_pool release]; return 0; @@ -591,27 +599,34 @@ static void QTScaleMatrix( vout_thread_t *p_vout ) Long2Fix( p_vout->output.i_height ) ); } - else if( i_height * p_vout->output.i_aspect < i_width * VOUT_ASPECT_FACTOR ) + else if( i_height * p_vout->fmt_in.i_visible_width * + p_vout->fmt_in.i_sar_num < + i_width * p_vout->fmt_in.i_visible_height * + p_vout->fmt_in.i_sar_den ) { - int i_adj_width = i_height * p_vout->output.i_aspect / - VOUT_ASPECT_FACTOR; + int i_adj_width = i_height * p_vout->fmt_in.i_visible_width * + p_vout->fmt_in.i_sar_num / + ( p_vout->fmt_in.i_sar_den * + p_vout->fmt_in.i_visible_height ); factor_x = FixDiv( Long2Fix( i_adj_width ), - Long2Fix( p_vout->output.i_width ) ); + Long2Fix( p_vout->fmt_in.i_visible_width ) ); factor_y = FixDiv( Long2Fix( i_height ), - Long2Fix( p_vout->output.i_height ) ); + Long2Fix( p_vout->fmt_in.i_visible_height ) ); i_offset_x = (i_width - i_adj_width) / 2; } else { - int i_adj_height = i_width * VOUT_ASPECT_FACTOR / - p_vout->output.i_aspect; + int i_adj_height = i_width * p_vout->fmt_in.i_visible_height * + p_vout->fmt_in.i_sar_den / + ( p_vout->fmt_in.i_sar_num * + p_vout->fmt_in.i_visible_width ); factor_x = FixDiv( Long2Fix( i_width ), - Long2Fix( p_vout->output.i_width ) ); + Long2Fix( p_vout->fmt_in.i_visible_width ) ); factor_y = FixDiv( Long2Fix( i_adj_height ), - Long2Fix( p_vout->output.i_height ) ); + Long2Fix( p_vout->fmt_in.i_visible_height ) ); i_offset_y = (i_height - i_adj_height) / 2; }