Commit fd78f83a authored by Damien Fouilleul's avatar Damien Fouilleul

voutgl: fix AR in mozilla plugin

parent ec3f4c88
...@@ -148,7 +148,7 @@ int E_(OpenVideoGL) ( vlc_object_t * p_this ) ...@@ -148,7 +148,7 @@ int E_(OpenVideoGL) ( vlc_object_t * p_this )
return VLC_EGENERIC; return VLC_EGENERIC;
} }
else { else {
// tell opengl not to sync buffer swap with vertical retrace // tell opengl not to sync buffer swap with vertical retrace (too inefficient)
GLint param = 0; GLint param = 0;
aglSetInteger(p_vout->p_sys->agl_ctx, AGL_SWAP_INTERVAL, &param); aglSetInteger(p_vout->p_sys->agl_ctx, AGL_SWAP_INTERVAL, &param);
aglEnable(p_vout->p_sys->agl_ctx, AGL_SWAP_INTERVAL); aglEnable(p_vout->p_sys->agl_ctx, AGL_SWAP_INTERVAL);
...@@ -489,44 +489,17 @@ static void aglEnd( vout_thread_t * p_vout ) ...@@ -489,44 +489,17 @@ static void aglEnd( vout_thread_t * p_vout )
static void aglReshape( vout_thread_t * p_vout ) static void aglReshape( vout_thread_t * p_vout )
{ {
int x, y; unsigned int x, y;
vlc_value_t val; unsigned int i_height = p_vout->p_sys->i_height;
int i_offx = p_vout->p_sys->i_offx; unsigned int i_width = p_vout->p_sys->i_width;
int i_offy = p_vout->p_sys->i_offy;
int i_height = p_vout->p_sys->i_height;
int i_width = p_vout->p_sys->i_width;
Lock( p_vout ); Lock( p_vout );
aglSetCurrentContext(p_vout->p_sys->agl_ctx); vout_PlacePicture(p_vout, i_width, i_height, &x, &y, &i_width, &i_height);
var_Get( p_vout, "macosx-stretch", &val );
if( val.b_bool )
{
x = i_width;
y = i_height;
}
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 )
{
x = ( i_height * p_vout->fmt_in.i_visible_width *
p_vout->fmt_in.i_sar_num ) /
( p_vout->fmt_in.i_visible_height * p_vout->fmt_in.i_sar_den);
y = i_height; aglSetCurrentContext(p_vout->p_sys->agl_ctx);
}
else
{
x = i_width;
y = ( i_width * p_vout->fmt_in.i_visible_height *
p_vout->fmt_in.i_sar_den) /
( p_vout->fmt_in.i_visible_width * p_vout->fmt_in.i_sar_num );
}
glViewport( i_offx+( i_width - x ) / 2, glViewport( p_vout->p_sys->i_offx + x, p_vout->p_sys->i_offy + y, i_width, i_height );
i_offy+( i_height - y ) / 2, x, y );
if( p_vout->p_sys->b_got_frame ) if( p_vout->p_sys->b_got_frame )
{ {
......
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