[MPlayer-cvslog] r36360 - in trunk/gui: interface.c interface.h ui/actions.c win32/gui.c win32/interface.c

ib subversion at mplayerhq.hu
Sat Jul 13 23:24:03 CEST 2013


Author: ib
Date: Sat Jul 13 23:24:03 2013
New Revision: 36360

Log:
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.

Modified:
   trunk/gui/interface.c
   trunk/gui/interface.h
   trunk/gui/ui/actions.c
   trunk/gui/win32/gui.c
   trunk/gui/win32/interface.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Sat Jul 13 21:48:12 2013	(r36359)
+++ trunk/gui/interface.c	Sat Jul 13 23:24:03 2013	(r36360)
@@ -640,7 +640,6 @@ int gui(int what, void *data)
         /* video */
 
         guiInfo.sh_video    = data;
-        guiInfo.VideoAspect = 0;
 
         nfree(guiInfo.CodecName);
 

Modified: trunk/gui/interface.h
==============================================================================
--- trunk/gui/interface.h	Sat Jul 13 21:48:12 2013	(r36359)
+++ trunk/gui/interface.h	Sat Jul 13 23:24:03 2013	(r36360)
@@ -104,7 +104,6 @@ typedef struct {
     int VideoWindow;
     int VideoWidth;
     int VideoHeight;
-    float VideoAspect;
 
     char *CodecName;
 

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Sat Jul 13 21:48:12 2013	(r36359)
+++ trunk/gui/ui/actions.c	Sat Jul 13 23:24:03 2013	(r36360)
@@ -425,9 +425,6 @@ play:
 
     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 @@ play:
 
         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);

Modified: trunk/gui/win32/gui.c
==============================================================================
--- trunk/gui/win32/gui.c	Sat Jul 13 21:48:12 2013	(r36359)
+++ trunk/gui/win32/gui.c	Sat Jul 13 23:24:03 2013	(r36360)
@@ -473,7 +473,6 @@ static LRESULT CALLBACK VideoProc(HWND h
                 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 @@ static LRESULT CALLBACK VideoProc(HWND h
                             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);

Modified: trunk/gui/win32/interface.c
==============================================================================
--- trunk/gui/win32/interface.c	Sat Jul 13 21:48:12 2013	(r36359)
+++ trunk/gui/win32/interface.c	Sat Jul 13 23:24:03 2013	(r36360)
@@ -628,7 +628,6 @@ int gui(int what, void *data)
         case GUI_SET_VIDEO:
         {
             guiInfo.sh_video = data;
-            guiInfo.VideoAspect = 0;
             if (data)
             {
                 sh_video_t *sh = data;


More information about the MPlayer-cvslog mailing list