# HG changeset patch # User reimar # Date 1351614842 0 # Node ID 48943c3398ff7e05121cf23aea768b7ec997cd2a # Parent 33e13b4ddfcbc10940f25f8ca717b01daff2959b Since the modecount variable is only ever initialized when the videmodes variable is, it also has to be a global variable. diff -r 33e13b4ddfcb -r 48943c3398ff libvo/x11_common.c --- a/libvo/x11_common.c Tue Oct 30 16:30:47 2012 +0000 +++ b/libvo/x11_common.c Tue Oct 30 16:34:02 2012 +0000 @@ -131,6 +131,7 @@ static int vo_old_height = 0; #ifdef CONFIG_XF86VM +static int modecount; XF86VidModeModeInfo **vidmodes = NULL; XF86VidModeModeLine modeline; #endif @@ -1631,8 +1632,6 @@ int X = vo_dwidth, Y = vo_dheight; int modeline_width, modeline_height; - int modecount; - if (XF86VidModeQueryExtension(mDisplay, &vm_event, &vm_error)) { XF86VidModeQueryVersion(mDisplay, &vm_ver, &vm_rev); @@ -1686,7 +1685,7 @@ { if (vidmodes != NULL) { - int i, modecount; + int i; free(vidmodes); vidmodes = NULL; @@ -1706,6 +1705,7 @@ XF86VidModeSwitchToMode(mDisplay, mScreen, vidmodes[i]); free(vidmodes); vidmodes = NULL; + modecount = 0; } } #endif