[MPlayer-cvslog] r38024 - trunk/gui/dialog/menu.c
ib
subversion at mplayerhq.hu
Tue Apr 3 13:50:42 EEST 2018
Author: ib
Date: Tue Apr 3 13:50:42 2018
New Revision: 38024
Log:
Show original aspect ratio information.
If the original aspect ratio is (close to) 4:3, 16:9 or 2.35:1,
add this information in parentheses to the aspect ratio menu item
"Original".
Modified:
trunk/gui/dialog/menu.c
Modified: trunk/gui/dialog/menu.c
==============================================================================
--- trunk/gui/dialog/menu.c Tue Apr 3 13:28:11 2018 (r38023)
+++ trunk/gui/dialog/menu.c Tue Apr 3 13:50:42 2018 (r38024)
@@ -646,7 +646,9 @@ GtkWidget * CreatePopUpMenu( void )
if ( guiInfo.VideoWindow )
{
- int a11 = False, a169 = False, a43 = False, a235 = False;
+ int a11 = False, a169 = False, a43 = False, a235 = False, ca = TRUE;
+ float a;
+ char *aspect = NULL, tmp[32];
if (movie_aspect == -1.0f) a11 = True;
else
@@ -656,8 +658,40 @@ GtkWidget * CreatePopUpMenu( void )
a235 = (FFABS(movie_aspect - 2.35f) <= 0.01f);
}
+ if ( guiInfo.sh_video )
+ {
+ a = FFABS(guiInfo.sh_video->original_aspect - 16.0f / 9.0f);
+
+ if (a <= 0.075f)
+ {
+ aspect = "16:9";
+
+ if (a <= 0.01f) ca = FALSE;
+ }
+
+ a = FFABS(guiInfo.sh_video->original_aspect - 4.0f / 3.0f);
+
+ if (a <= 0.075f)
+ {
+ aspect = "4:3";
+
+ if (a <= 0.01f) ca = FALSE;
+ }
+
+ a = FFABS(guiInfo.sh_video->original_aspect - 2.35f);
+
+ if (a <= 0.075f)
+ {
+ aspect = MSGTR_GUI_235To1;
+
+ if (a <= 0.01f) ca = FALSE;
+ }
+ }
+
+ snprintf(tmp, sizeof(tmp), "%s%s%s%s%s", MSGTR_GUI_Original, aspect ? " (" : "", aspect && ca ? "≈" : "", aspect ? aspect : "", aspect ? ")" : "");
+
AspectMenu=AddSubMenu( window1, (const char*)aspect_xpm, Menu,MSGTR_GUI_AspectRatio );
- H=AddMenuCheckItem( window1, (const char*)aspect11_xpm, AspectMenu,MSGTR_GUI_Original, a11, evSetAspect + ( 1 << 16 ) );
+ H=AddMenuCheckItem( window1, (const char*)aspect11_xpm, AspectMenu,tmp, a11, evSetAspect + ( 1 << 16 ) );
N=AddMenuCheckItem( window1, (const char*)aspect169_xpm, AspectMenu,"16:9", a169, evSetAspect + ( 2 << 16 ) );
D=AddMenuCheckItem( window1, (const char*)aspect43_xpm, AspectMenu,"4:3", a43, evSetAspect + ( 3 << 16 ) );
F=AddMenuCheckItem( window1, (const char*)aspect235_xpm, AspectMenu,MSGTR_GUI_235To1, a235, evSetAspect + ( 4 << 16 ) );
More information about the MPlayer-cvslog
mailing list