[MPlayer-cvslog] r33982 - in trunk/gui: interface.c interface.h ui/gtk/fileselect.c ui/gtk/playlist.c ui/gtk/url.c win32/interface.c

ib subversion at mplayerhq.hu
Fri Aug 12 16:09:36 CEST 2011


Author: ib
Date: Fri Aug 12 16:09:36 2011
New Revision: 33982

Log:
Remove needless guiInfo member FilenameChanged.

Use existing member NewPlay for this, because FilenameChanged
and NewPlay == GUI_FILE_NEW mean the same.

Modified:
   trunk/gui/interface.c
   trunk/gui/interface.h
   trunk/gui/ui/gtk/fileselect.c
   trunk/gui/ui/gtk/playlist.c
   trunk/gui/ui/gtk/url.c
   trunk/gui/win32/interface.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Fri Aug 12 15:31:44 2011	(r33981)
+++ trunk/gui/interface.c	Fri Aug 12 16:09:36 2011	(r33982)
@@ -382,8 +382,8 @@ int gui(int what, void *data)
 
     case GUI_SET_FILE:
 
-// if ( guiInfo.Playing == 1 && guiInfo.FilenameChanged )
-        if (guiInfo.FilenameChanged) {
+// if ( guiInfo.Playing == 1 && guiInfo.NewPlay == GUI_FILE_NEW )
+        if (guiInfo.NewPlay == GUI_FILE_NEW) {
             audio_id  = -1;
             video_id  = -1;
             dvdsub_id = -1;
@@ -628,12 +628,11 @@ int gui(int what, void *data)
 
         if (guiInfo.AudioFile)
             audio_stream = gstrdup(guiInfo.AudioFile);
-        else if (guiInfo.FilenameChanged)
+        else if (guiInfo.NewPlay == GUI_FILE_NEW)
             nfree(audio_stream);
 
 // audio_stream = NULL;
 
-        guiInfo.FilenameChanged = 0;
         guiInfo.NewPlay = 0;
 
 #ifdef CONFIG_ASS
@@ -788,12 +787,11 @@ int gui(int what, void *data)
             plLastPlayed = next;
             setddup(&guiInfo.Filename, next->path, next->name);
             guiInfo.StreamType      = STREAMTYPE_FILE;
-            guiInfo.FilenameChanged = 1;
             guiInfo.NewPlay = GUI_FILE_NEW;
             nfree(guiInfo.AudioFile);
             nfree(guiInfo.Subtitlename);
         } else {
-            if (guiInfo.FilenameChanged || (guiInfo.NewPlay == GUI_FILE_NEW))
+            if (guiInfo.NewPlay == GUI_FILE_NEW)
                 break;
 
             guiInfo.TimeSec       = 0;

Modified: trunk/gui/interface.h
==============================================================================
--- trunk/gui/interface.h	Fri Aug 12 15:31:44 2011	(r33981)
+++ trunk/gui/interface.h	Fri Aug 12 16:09:36 2011	(r33982)
@@ -129,7 +129,6 @@ typedef struct {
     int LengthInSec;
 
     char *Filename;
-    int FilenameChanged;
 
     char *Subtitlename;
 

Modified: trunk/gui/ui/gtk/fileselect.c
==============================================================================
--- trunk/gui/ui/gtk/fileselect.c	Fri Aug 12 15:31:44 2011	(r33981)
+++ trunk/gui/ui/gtk/fileselect.c	Fri Aug 12 16:09:36 2011	(r33982)
@@ -491,7 +491,7 @@ static void fs_Ok_released( GtkButton * 
    case fsVideoSelector:
           setddup( &guiInfo.Filename,fsSelectedDirectory,fsSelectedFile );
           guiInfo.StreamType=STREAMTYPE_FILE;
-          guiInfo.FilenameChanged=1; sub_fps=0;
+          guiInfo.NewPlay=GUI_FILE_NEW; sub_fps=0;
 	  nfree( guiInfo.AudioFile );
 	  nfree( guiInfo.Subtitlename );
           fs_PersistantHistory( get_current_dir_name_utf8() );      //totem, write into history

Modified: trunk/gui/ui/gtk/playlist.c
==============================================================================
--- trunk/gui/ui/gtk/playlist.c	Fri Aug 12 15:31:44 2011	(r33981)
+++ trunk/gui/ui/gtk/playlist.c	Fri Aug 12 16:09:36 2011	(r33982)
@@ -209,7 +209,7 @@ static void plButtonReleased( GtkButton 
 	 {
 	  uiSetFileName( plCurrent->path,plCurrent->name,STREAMTYPE_FILE );
 //	  setddup( &guiInfo.Filename,plCurrent->path,plCurrent->name );
-//	  guiInfo.FilenameChanged=1;
+//	  guiInfo.NewPlay=GUI_FILE_NEW;
 //	  guiInfo.StreamType=STREAMTYPE_FILE;
 	 }
        }

Modified: trunk/gui/ui/gtk/url.c
==============================================================================
--- trunk/gui/ui/gtk/url.c	Fri Aug 12 15:31:44 2011	(r33981)
+++ trunk/gui/ui/gtk/url.c	Fri Aug 12 16:09:36 2011	(r33982)
@@ -103,7 +103,7 @@ static void on_Button_pressed( GtkButton
      item->url=gstrdup( str );
      listSet( gtkAddURLItem,item );
 
-     setdup( &guiInfo.Filename,str ); guiInfo.FilenameChanged=1;
+     setdup( &guiInfo.Filename,str ); guiInfo.NewPlay=GUI_FILE_NEW;
      uiEventHandling( evPlayNetwork,0 );
     }
   }

Modified: trunk/gui/win32/interface.c
==============================================================================
--- trunk/gui/win32/interface.c	Fri Aug 12 15:31:44 2011	(r33981)
+++ trunk/gui/win32/interface.c	Fri Aug 12 16:09:36 2011	(r33982)
@@ -242,7 +242,6 @@ static void guiSetEvent(int event)
 #endif
                 default:
                 {
-                    guiInfo.FilenameChanged = 1;
                     guiInfo.NewPlay = GUI_FILE_NEW;
                     update_playlistwindow();
                     uiGotoTheNext = guiInfo.Playing? 0 : 1;
@@ -448,7 +447,6 @@ int gui(int what, void *data)
         case GUI_PREPARE:
         {
             gui(GUI_SET_FILE, 0);
-            guiInfo.FilenameChanged = 0;
             guiInfo.NewPlay = 0;
             switch(guiInfo.StreamType)
             {
@@ -657,13 +655,13 @@ int gui(int what, void *data)
               if(movie_aspect >= 0)
                   movie_aspect = -1;
 
-              uiGotoTheNext = guiInfo.FilenameChanged = 1;
+              uiGotoTheNext = 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 == GUI_FILE_NEW))
+          if(guiInfo.NewPlay == GUI_FILE_NEW)
               break;
 
           guiInfo.TimeSec = 0;


More information about the MPlayer-cvslog mailing list