[MPlayer-cvslog] r33978 - in trunk: gui/interface.c gui/interface.h gui/ui/main.c gui/win32/interface.c mplayer.c

ib subversion at mplayerhq.hu
Fri Aug 12 15:14:14 CEST 2011


Author: ib
Date: Fri Aug 12 15:14:13 2011
New Revision: 33978

Log:
Remove needless guiInfo member DiskChanged.

Use existing member NewPlay for this, because DiskChanged means
NewPlay but with the same file.

The #ifdef CONFIG_DVDREAD has been removed, because this affects
CONFIG_VCD as well and NewPlay is always available.

Modified:
   trunk/gui/interface.c
   trunk/gui/interface.h
   trunk/gui/ui/main.c
   trunk/gui/win32/interface.c
   trunk/mplayer.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Fri Aug 12 12:23:25 2011	(r33977)
+++ trunk/gui/interface.c	Fri Aug 12 15:14:13 2011	(r33978)
@@ -633,7 +633,6 @@ int gui(int what, void *data)
 
 // audio_stream = NULL;
 
-        guiInfo.DiskChanged     = 0;
         guiInfo.FilenameChanged = 0;
         guiInfo.NewPlay = 0;
 
@@ -789,11 +788,12 @@ int gui(int what, void *data)
             plLastPlayed = next;
             setddup(&guiInfo.Filename, next->path, next->name);
             guiInfo.StreamType      = STREAMTYPE_FILE;
-            guiInfo.FilenameChanged = guiInfo.NewPlay = 1;
+            guiInfo.FilenameChanged = 1;
+            guiInfo.NewPlay = GUI_FILE_NEW;
             nfree(guiInfo.AudioFile);
             nfree(guiInfo.Subtitlename);
         } else {
-            if (guiInfo.FilenameChanged || guiInfo.NewPlay)
+            if (guiInfo.FilenameChanged || (guiInfo.NewPlay == GUI_FILE_NEW))
                 break;
 
             guiInfo.TimeSec       = 0;

Modified: trunk/gui/interface.h
==============================================================================
--- trunk/gui/interface.h	Fri Aug 12 12:23:25 2011	(r33977)
+++ trunk/gui/interface.h	Fri Aug 12 15:14:13 2011	(r33978)
@@ -59,6 +59,9 @@ enum {
 #define GUI_PLAY  1
 #define GUI_PAUSE 2
 
+#define GUI_FILE_SAME 1
+#define GUI_FILE_NEW  2
+
 enum {
     MPLAYER_EXIT_GUI,
     MPLAYER_SET_AUTO_QUALITY,
@@ -91,7 +94,6 @@ typedef struct {
     sh_video_t *sh_video;
     af_stream_t *afilter;
 
-    int DiskChanged;
     int NewPlay;
 
 #ifdef CONFIG_DVDREAD

Modified: trunk/gui/ui/main.c
==============================================================================
--- trunk/gui/ui/main.c	Fri Aug 12 12:23:25 2011	(r33977)
+++ trunk/gui/ui/main.c	Fri Aug 12 15:14:13 2011	(r33978)
@@ -201,6 +201,7 @@ play:
 	  case STREAMTYPE_STREAM:
 	  case STREAMTYPE_FILE:
 	       guiInfoMediumClear( CLEAR_ALL - CLEAR_FILE );
+	       guiInfo.NewPlay=GUI_FILE_NEW;
 	       break;
 #ifdef CONFIG_VCD
           case STREAMTYPE_VCD:
@@ -211,7 +212,7 @@ play:
 	        {
 		 if ( !guiInfo.Track )
                    guiInfo.Track=2;
-                 guiInfo.DiskChanged=1;
+                 guiInfo.NewPlay=GUI_FILE_SAME;
 		}
 	       break;
 #endif
@@ -222,12 +223,11 @@ play:
 	       uiSetFileName( NULL,dvd_device,STREAMTYPE_DVD );
 	       if ( guiInfo.Playing != GUI_PAUSE )
 	        {
-                 guiInfo.DiskChanged=1;
+                 guiInfo.NewPlay=GUI_FILE_SAME;
 		}
                break;
 #endif
          }
-	guiInfo.NewPlay=1;
         uiPlay();
         break;
 #ifdef CONFIG_DVDREAD
@@ -391,7 +391,7 @@ set_volume:
 	if ( guiInfo.StreamType == STREAMTYPE_DVD || guiInfo.StreamType == STREAMTYPE_VCD ) goto play_dvd_2;
 	 else
 #endif
-	 guiInfo.NewPlay=1;
+	 guiInfo.NewPlay=GUI_FILE_NEW;
 	break;
 
 // --- timer events

Modified: trunk/gui/win32/interface.c
==============================================================================
--- trunk/gui/win32/interface.c	Fri Aug 12 12:23:25 2011	(r33977)
+++ trunk/gui/win32/interface.c	Fri Aug 12 15:14:13 2011	(r33978)
@@ -117,7 +117,7 @@ static void guiSetEvent(int event)
             guiInfo.Track = dvd_title;
             guiInfo.Chapter = dvd_chapter;
             guiInfo.Angle = dvd_angle;
-            guiInfo.DiskChanged = 1;
+            guiInfo.NewPlay = GUI_FILE_SAME;
 
             uiSetFileName(NULL, dvd_device, STREAMTYPE_DVD);
             dvdname[0] = 0;
@@ -235,14 +235,15 @@ static void guiSetEvent(int event)
 #ifdef CONFIG_DVDREAD
                 case STREAMTYPE_DVD:
                 {
-                    guiInfo.DiskChanged = 1;
+                    guiInfo.NewPlay = GUI_FILE_SAME;
                     gui(GUI_SET_STATE, (void *) GUI_PLAY);
                     break;
                 }
 #endif
                 default:
                 {
-                    guiInfo.FilenameChanged = guiInfo.NewPlay = 1;
+                    guiInfo.FilenameChanged = 1;
+                    guiInfo.NewPlay = GUI_FILE_NEW;
                     update_playlistwindow();
                     uiGotoTheNext = guiInfo.Playing? 0 : 1;
                     gui(GUI_SET_STATE, (void *) GUI_STOP);
@@ -271,7 +272,7 @@ void uiPlay( void )
        uiPause();
        return;
    }
-   guiInfo.NewPlay = 1;
+   guiInfo.NewPlay = GUI_FILE_NEW;
    gui(GUI_SET_STATE, (void *) GUI_PLAY);
 }
 
@@ -447,7 +448,6 @@ int gui(int what, void *data)
         case GUI_PREPARE:
         {
             gui(GUI_SET_FILE, 0);
-            guiInfo.DiskChanged = 0;
             guiInfo.FilenameChanged = 0;
             guiInfo.NewPlay = 0;
             switch(guiInfo.StreamType)
@@ -657,12 +657,13 @@ int gui(int what, void *data)
               if(movie_aspect >= 0)
                   movie_aspect = -1;
 
-              uiGotoTheNext = guiInfo.FilenameChanged = guiInfo.NewPlay = 1;
+              uiGotoTheNext = guiInfo.FilenameChanged = 1;
+              guiInfo.NewPlay = GUI_FILE_NEW;
               uiSetFileName(NULL, mygui->playlist->tracks[(mygui->playlist->current)++]->filename, STREAMTYPE_STREAM);
               //sprintf(guiInfo.Filename, mygui->playlist->tracks[(mygui->playlist->current)++]->filename);
           }
 
-          if(guiInfo.FilenameChanged && guiInfo.NewPlay)
+          if(guiInfo.FilenameChanged && (guiInfo.NewPlay == GUI_FILE_NEW))
               break;
 
           guiInfo.TimeSec = 0;

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Fri Aug 12 12:23:25 2011	(r33977)
+++ trunk/mplayer.c	Fri Aug 12 15:14:13 2011	(r33978)
@@ -3977,7 +3977,7 @@ goto_enable_cache:
                     break;                  // STOP
                 if (guiInfo.Playing == GUI_PAUSE)
                     mpctx->osd_function = OSD_PAUSE;
-                if (guiInfo.DiskChanged || guiInfo.NewPlay)
+                if (guiInfo.NewPlay)
                     goto goto_next_file;
 #ifdef CONFIG_DVDREAD
                 if (mpctx->stream->type == STREAMTYPE_DVD) {
@@ -4076,9 +4076,7 @@ goto_next_file:  // don't jump here afte
 
 #ifdef CONFIG_GUI
     if (use_gui) {
-#ifdef CONFIG_DVDREAD
-        if (!guiInfo.DiskChanged)
-#endif
+        if (guiInfo.NewPlay != GUI_FILE_SAME)
         gui(GUI_END_FILE, 0);
     }
 #endif


More information about the MPlayer-cvslog mailing list