[MPlayer-dev-eng] [PATCH] GUI: fix sound mute switch

Stanislav Maslovski stanislav.maslovski at gmail.com
Tue Sep 19 07:53:49 CEST 2006


This patch fixes the sound mute switch in the GUI menu by moving the
corresponding piece of GUI code in mplayer.c after audio initialization.
It should not break other things. If somebody is worried about displacing
that "goto" in the GUI code, its purpose is to just skip the current file
in the playlist if something goes wrong with setting audio/video params
inside guiGetEvent(guiSetValues,...).

-- 
Stanislav
-------------- next part --------------
Index: mplayer.c
===================================================================
--- mplayer.c	(revision 19905)
+++ mplayer.c	(working copy)
@@ -3875,17 +3875,6 @@
 if(verbose) term_osd = 0;
 fflush(stdout);
 
-#ifdef HAVE_NEW_GUI
-   if ( use_gui )
-    {
-     if ( sh_audio ) guiIntfStruct.AudioType=sh_audio->channels; else guiIntfStruct.AudioType=0;
-     if ( !sh_video && sh_audio ) guiGetEvent( guiSetAudioOnly,(char *)1 ); else guiGetEvent( guiSetAudioOnly,(char *)0 );
-     guiGetEvent( guiSetFileFormat,(char *)demuxer->file_format );
-     if ( guiGetEvent( guiSetValues,(char *)sh_video ) ) goto goto_next_file;
-     guiGetEvent( guiSetDemuxer,(char *)demuxer );
-    }
-#endif
-
 {
 //int frame_corr_num=0;   //
 //float v_frame=0;    // Video
@@ -3958,6 +3947,17 @@
   mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_FPSforced,sh_video->fps,sh_video->frametime);
 }
 
+#ifdef HAVE_NEW_GUI
+   if ( use_gui )
+    {
+     if ( sh_audio ) guiIntfStruct.AudioType=sh_audio->channels; else guiIntfStruct.AudioType=0;
+     if ( !sh_video && sh_audio ) guiGetEvent( guiSetAudioOnly,(char *)1 ); else guiGetEvent( guiSetAudioOnly,(char *)0 );
+     guiGetEvent( guiSetFileFormat,(char *)demuxer->file_format );
+     if ( guiGetEvent( guiSetValues,(char *)sh_video ) ) goto goto_next_file;
+     guiGetEvent( guiSetDemuxer,(char *)demuxer );
+    }
+#endif
+
 //==================== START PLAYING =======================
 
 if(loop_times>1) loop_times--; else


More information about the MPlayer-dev-eng mailing list