[Mplayer-cvslog] CVS: main/Gui/mplayer mw.c,1.96,1.97 play.c,1.78,1.79

Zoltan Ponekker pontscho at mplayerhq.hu
Wed Dec 11 02:21:43 CET 2002


Update of /cvsroot/mplayer/main/Gui/mplayer
In directory mail:/var/tmp.root/cvs-serv25933/Gui/mplayer

Modified Files:
	mw.c play.c 
Log Message:


- fix three submenu bug
	- audio/video track hiding
	- normal/double/fullscreen handling
	- dvd audio channel setting bug
- fix file/url/vcd/dvd playing
- fix variables initialization
- some small bug fix
- applied some patch from Rüdiger Kuhlmann


Index: mw.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/mw.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -r1.96 -r1.97
--- mw.c	5 Dec 2002 23:54:15 -0000	1.96
+++ mw.c	11 Dec 2002 01:21:09 -0000	1.97
@@ -252,6 +252,7 @@
 void mplEventHandling( int msg,float param )
 {
  int j;
+ int iparam = (int)param;
 
  switch( msg )
   {
@@ -270,22 +271,20 @@
 	break;
 
    case evSetAudio:
-        if ( !guiIntfStruct.demuxer ) break;
-	audio_id=(int)param;
-	if ( guiIntfStruct.StreamType == STREAMTYPE_DVD ) goto play;
-	guiIntfStruct.FilenameChanged=1;
+        if ( !guiIntfStruct.demuxer || audio_id == iparam ) break;
+	audio_id=iparam;
+	guiIntfStruct.NewPlay=1;
 	break;
 
    case evSetVideo:
-        if ( !guiIntfStruct.demuxer ) break;
-        video_id=(int)param;
-        if ( guiIntfStruct.StreamType == STREAMTYPE_DVD ) goto play;
-        guiIntfStruct.FilenameChanged=1;
-        break;
+        if ( !guiIntfStruct.demuxer || video_id == iparam ) break;
+	video_id=iparam;
+	guiIntfStruct.NewPlay=1;
+	break;
 
 #ifdef HAVE_VCD
    case evSetVCDTrack:
-        guiIntfStruct.Track=(int)param;
+        guiIntfStruct.Track=iparam;
    case evPlayVCD:
  	gtkSet( gtkClearStruct,0,(void *)guiALL );
 	guiIntfStruct.StreamType=STREAMTYPE_VCD;
@@ -299,6 +298,7 @@
 play_dvd_2:
  	gtkSet( gtkClearStruct,0,(void *)(guiALL - guiDVD) );
         guiIntfStruct.StreamType=STREAMTYPE_DVD;
+	goto play;
 #endif
    case evPlay:
    case evPlaySwitchToPause:
@@ -306,18 +306,11 @@
 
         if ( ( msg == evPlaySwitchToPause )&&( guiIntfStruct.Playing == 2 ) ) goto NoPause;
 
-	vcd_track=0;
-	dvd_title=0;
-
 	if ( gtkSet( gtkGetCurrPlItem,0,NULL ) &&( guiIntfStruct.StreamType == STREAMTYPE_FILE ) )
 	 {
 	  plItem * next = gtkSet( gtkGetCurrPlItem,0,NULL );
 	  plLastPlayed=next;
-	  guiSetDF( guiIntfStruct.Filename,next->path,next->name );
-	  guiIntfStruct.StreamType=STREAMTYPE_FILE;
-	  guiIntfStruct.FilenameChanged=1;
-	  gfree( (void **)&guiIntfStruct.AudioFile );
-	  gfree( (void **)&guiIntfStruct.Subtitlename );
+	  mplSetFileName( next->path,next->name,STREAMTYPE_FILE );
 	 }
 
         switch ( guiIntfStruct.StreamType )
@@ -335,10 +328,9 @@
 	        {
 		 if ( !guiIntfStruct.Track )
 		  {
-		   if ( guiIntfStruct.VCDTracks == 1 ) guiIntfStruct.Track=1;
-		    else guiIntfStruct.Track=2;
+		   if ( guiIntfStruct.VCDTracks > 1 ) guiIntfStruct.Track=2;
+		    else guiIntfStruct.Track=1;
 		  }
-		 vcd_track=guiIntfStruct.Track;
                  guiIntfStruct.DiskChanged=1;
 		}
 	       break;
@@ -350,31 +342,32 @@
 	       mplSetFileName( NULL,dvd_device,STREAMTYPE_DVD );
 	       if ( guiIntfStruct.Playing != 2 )
 	        {
-	         dvd_title=guiIntfStruct.DVD.current_title;
-	         dvd_angle=guiIntfStruct.DVD.current_angle;
-                 dvd_chapter=guiIntfStruct.DVD.current_chapter;
+		 guiIntfStruct.Title=guiIntfStruct.DVD.current_title;
+		 guiIntfStruct.Chapter=guiIntfStruct.DVD.current_chapter;
+		 guiIntfStruct.Angle=guiIntfStruct.DVD.current_angle;
                  guiIntfStruct.DiskChanged=1;
 		} 
                break;
 #endif
          }
+	guiIntfStruct.NewPlay=1;
         mplPlay();
         break;
 #ifdef USE_DVDREAD
    case evSetDVDSubtitle:
-        dvdsub_id=(int)param;
+        dvdsub_id=iparam;
         goto play_dvd_2;
         break;
    case evSetDVDAudio:
-        audio_id=(int)param;
+        audio_id=iparam;
         goto play_dvd_2;
         break;
    case evSetDVDChapter:
-        guiIntfStruct.DVD.current_chapter=(int)param;
+        guiIntfStruct.DVD.current_chapter=iparam;
         goto play_dvd_2;
         break;
    case evSetDVDTitle:
-        guiIntfStruct.DVD.current_title=(int)param;
+        guiIntfStruct.DVD.current_title=iparam;
 	guiIntfStruct.DVD.current_chapter=1;
 	guiIntfStruct.DVD.current_angle=1;
         goto play_dvd_2;
@@ -387,7 +380,11 @@
         mplPause();
         break;
 
-   case evStop: guiIntfStruct.Playing=guiSetStop; mplState(); break;
+   case evStop: 
+	guiIntfStruct.Playing=guiSetStop; 
+	mplState(); 
+	guiIntfStruct.NoWindow=False;
+	break;
 
    case evLoadPlay:
         mplMainAutoPlay=1;
@@ -448,7 +445,7 @@
 
 
    case evIconify:
-        switch ( (int)param )
+        switch ( iparam )
          {
           case 0: wsIconify( appMPlayer.mainWindow ); break;
           case 1: wsIconify( appMPlayer.subWindow ); break;
@@ -489,7 +486,7 @@
         break;
 
    case evSetAspect:
-	switch ( (int)param )
+	switch ( iparam )
 	 {
 	  case 2:  movie_aspect=16.0f / 9.0f; break;
 	  case 3:  movie_aspect=4.0f / 3.0f;  break;
@@ -499,10 +496,10 @@
 	 }
 	wsClearWindow( appMPlayer.subWindow );
 #ifdef USE_DVDREAD
-	if ( guiIntfStruct.StreamType == STREAMTYPE_DVD ) goto play_dvd_2;
+	if ( guiIntfStruct.StreamType == STREAMTYPE_DVD || guiIntfStruct.StreamType == STREAMTYPE_VCD ) goto play_dvd_2;
 	 else 
 #endif
-	 guiIntfStruct.FilenameChanged=1;
+	 guiIntfStruct.NewPlay=1;
 	break;
 
 // --- timer events

Index: play.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/play.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -r1.78 -r1.79
--- play.c	25 Nov 2002 17:33:27 -0000	1.78
+++ play.c	11 Dec 2002 01:21:09 -0000	1.79
@@ -10,6 +10,7 @@
 #include "../wm/ws.h"
 #include "../../config.h"
 #include "../../help_mp.h"
+#include "../../mplayer.h"
 #include "../../libvo/x11_common.h"
 #include "../../input/input.h"
 
@@ -99,7 +100,7 @@
    plLastPlayed=next;
    guiSetDF( guiIntfStruct.Filename,next->path,next->name );
    guiIntfStruct.StreamType=STREAMTYPE_FILE;
-   guiIntfStruct.FilenameChanged=1;
+   guiIntfStruct.FilenameChanged=guiIntfStruct.NewPlay=1;
    gfree( (void **)&guiIntfStruct.AudioFile );
    gfree( (void **)&guiIntfStruct.Subtitlename );
   } 
@@ -110,6 +111,8 @@
      guiIntfStruct.TimeSec=0;
      guiIntfStruct.Position=0;
      guiIntfStruct.AudioType=0;
+     guiIntfStruct.NoWindow=False;
+
 #ifdef USE_DVDREAD
      guiIntfStruct.DVD.current_title=1;
      guiIntfStruct.DVD.current_chapter=1;
@@ -255,10 +258,10 @@
  if ( !name ) return;
  
  if ( !dir ) guiSetFilename( guiIntfStruct.Filename,name )
-  else guiSetDF( guiIntfStruct.Filename,dir,name )
+  else guiSetDF( guiIntfStruct.Filename,dir,name );
 
+// filename=guiIntfStruct.Filename;
  guiIntfStruct.StreamType=type;
- guiIntfStruct.FilenameChanged=1;
  gfree( (void **)&guiIntfStruct.AudioFile );
  gfree( (void **)&guiIntfStruct.Subtitlename );
 }




More information about the MPlayer-cvslog mailing list