changeset 32967:d9363dbd3f83

Avoid mixing declaration and code. Additionally, move assignment where variable is used.
author ib
date Tue, 08 Mar 2011 13:12:30 +0000
parents 1f51f39916e1
children 1fa7a299b1b4
files gui/mplayer/gui_common.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gui/mplayer/gui_common.c	Tue Mar 08 13:03:22 2011 +0000
+++ b/gui/mplayer/gui_common.c	Tue Mar 08 13:12:30 2011 +0000
@@ -109,12 +109,12 @@
 /* Unsafe!  Pass only null-terminated strings as (char *)str. */
 char *Translate(char *str)
 {
-    mixer_t *mixer = mpctx_get_mixer(guiIntfStruct.mpcontext);
     static char trbuf[512];
     char tmp[512];
     int i, c;
     int t;
     int strsize = 0;
+    mixer_t *mixer;
 
     memset(trbuf, 0, 512);
     memset(tmp, 0, 128);
@@ -245,6 +245,8 @@
 
             case 'a':
 
+                mixer = mpctx_get_mixer(guiIntfStruct.mpcontext);
+
                 if (mixer->muted) {
                     av_strlcat(trbuf, "n", sizeof(trbuf));
                     break;