# HG changeset patch # User ib # Date 1373750643 0 # Node ID bf9a9e07377a846d53034764892e8dfba6cbe174 # Parent ea4c4dbae852bc58e1f9f4bc9720fa5afeac3f3b Calculate aspect ratio by ourselves. sh_video->aspect is a prescaled value that is useless in case there is more than one video to be played and the aspect ratio of a previous one has been changed. diff -r ea4c4dbae852 -r bf9a9e07377a gui/interface.c --- a/gui/interface.c Sat Jul 13 19:48:12 2013 +0000 +++ b/gui/interface.c Sat Jul 13 21:24:03 2013 +0000 @@ -640,7 +640,6 @@ /* video */ guiInfo.sh_video = data; - guiInfo.VideoAspect = 0; nfree(guiInfo.CodecName); diff -r ea4c4dbae852 -r bf9a9e07377a gui/interface.h --- a/gui/interface.h Sat Jul 13 19:48:12 2013 +0000 +++ b/gui/interface.h Sat Jul 13 21:24:03 2013 +0000 @@ -104,7 +104,6 @@ int VideoWindow; int VideoWidth; int VideoHeight; - float VideoAspect; char *CodecName; diff -r ea4c4dbae852 -r bf9a9e07377a gui/ui/actions.c --- a/gui/ui/actions.c Sat Jul 13 19:48:12 2013 +0000 +++ b/gui/ui/actions.c Sat Jul 13 21:24:03 2013 +0000 @@ -425,9 +425,6 @@ case evSetAspect: - if (guiInfo.VideoAspect == 0) - guiInfo.VideoAspect = guiInfo.sh_video->aspect; - switch (iparam) { case 2: aspect = 16.0f / 9.0f; @@ -443,7 +440,7 @@ case 1: default: - aspect = guiInfo.VideoAspect; + aspect = (float)guiInfo.sh_video->disp_w / guiInfo.sh_video->disp_h; } snprintf(cmd, sizeof(cmd), "switch_ratio %f", aspect); diff -r ea4c4dbae852 -r bf9a9e07377a gui/win32/gui.c --- a/gui/win32/gui.c Sat Jul 13 19:48:12 2013 +0000 +++ b/gui/win32/gui.c Sat Jul 13 21:24:03 2013 +0000 @@ -473,7 +473,6 @@ case ID_ASPECT2: case ID_ASPECT3: case ID_ASPECT4: - if (guiInfo.VideoAspect == 0) guiInfo.VideoAspect = guiInfo.sh_video->aspect; switch (LOWORD(wParam)) { case ID_ASPECT1: @@ -486,7 +485,7 @@ aspect = 2.35; break; default: - aspect = guiInfo.VideoAspect; + aspect = (float) guiInfo.sh_video->disp_w / guiInfo.sh_video->disp_h; break; } snprintf(cmd, sizeof(cmd), "switch_ratio %f", aspect); diff -r ea4c4dbae852 -r bf9a9e07377a gui/win32/interface.c --- a/gui/win32/interface.c Sat Jul 13 19:48:12 2013 +0000 +++ b/gui/win32/interface.c Sat Jul 13 21:24:03 2013 +0000 @@ -628,7 +628,6 @@ case GUI_SET_VIDEO: { guiInfo.sh_video = data; - guiInfo.VideoAspect = 0; if (data) { sh_video_t *sh = data;