[Mplayer-cvslog] CVS: main mplayer.c,1.419,1.420

Zoltan Ponekker pontscho at mplayer.dev.hu
Wed Mar 6 19:42:58 CET 2002


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv23559

Modified Files:
	mplayer.c 
Log Message:
bazmeg a playtree - t

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.419
retrieving revision 1.420
diff -u -r1.419 -r1.420
--- mplayer.c	5 Mar 2002 08:51:57 -0000	1.419
+++ mplayer.c	6 Mar 2002 18:42:55 -0000	1.420
@@ -673,16 +673,6 @@
   }
 #endif
 
-  // It's time to init the GUI code: (and fork() the GTK process)
-#ifdef HAVE_NEW_GUI
-  if(use_gui){
-       guiInit( argc,argv,envp );
-       inited_flags|=INITED_GUI;
-       guiIntfStruct.Playing= (gui_no_filename) ? 0 : 1;
-       mplState();
-  }
-#endif
-
 #if defined(HAVE_LIRC) && ! defined(HAVE_NEW_INPUT)
   lirc_mp_setup();
   inited_flags|=INITED_LIRC;
@@ -723,6 +713,17 @@
 // ========== Init keyboard FIFO (connection to libvo) ============
 make_pipe(&keyb_fifo_get,&keyb_fifo_put);
 
+  // It's time to init the GUI code: (and fork() the GTK process)
+#ifdef HAVE_NEW_GUI
+  if(use_gui){
+       guiInit( argc,argv,envp );
+       inited_flags|=INITED_GUI;
+       guiIntfStruct.Playing= (gui_no_filename) ? 0 : 1;
+       mplState();
+  }
+#endif
+
+
 // Init input system
 #ifdef HAVE_NEW_INPUT
 current_module = "init_input";
@@ -777,7 +778,7 @@
       }
 #endif
 
-      if(filename && !guiIntfStruct.FilenameChanged) guiSetFilename( guiIntfStruct.Filename,filename );
+//      if(filename && !guiIntfStruct.FilenameChanged) guiSetFilename( guiIntfStruct.Filename,filename );
 //      guiIntfStruct.Playing= (gui_no_filename) ? 0 : 1;
       while(guiIntfStruct.Playing!=1){
         mp_cmd_t* cmd;                                                                                   
@@ -795,11 +796,36 @@
         guiIntfStruct.SubtitleChanged=0;
        }
 #endif
-
       if ( guiIntfStruct.FilenameChanged || !filename )
        {
-        filename=strdup( guiIntfStruct.Filename );
-	guiIntfStruct.FilenameChanged=0;
+        play_tree_t * entry = play_tree_new();
+        play_tree_add_file( entry,guiIntfStruct.Filename );
+        if ( playtree )
+	 {
+          play_tree_free_list( playtree->child,1 );
+          play_tree_set_child( playtree,entry );
+	 }
+          else
+           {
+	    fprintf( stderr,"[mplayer] new playtree created.\n" );
+            if ( !playtree ) playtree=play_tree_new();
+            play_tree_set_child( playtree,entry );
+           }
+
+        if(playtree->child)
+	 {
+	  playtree_iter = play_tree_iter_new(playtree->child,mconfig);
+	  if(playtree_iter)
+	   {
+	    if(play_tree_iter_step(playtree_iter,0,0) != PLAY_TREE_ITER_ENTRY)
+	     {
+	      play_tree_iter_free(playtree_iter);
+	      playtree_iter = NULL;
+	     }
+	    filename = play_tree_iter_get_file(playtree_iter,1);
+	   }
+         }
+   	guiIntfStruct.FilenameChanged=0;
        }
     }
 #endif
@@ -1401,7 +1427,7 @@
      guiIntfStruct.MovieWidth=sh_video->disp_w;
      guiIntfStruct.MovieHeight=sh_video->disp_h;
      guiIntfStruct.StreamType=stream->type;
-     guiSetFilename( guiIntfStruct.Filename,filename );
+//     guiSetFilename( guiIntfStruct.Filename,filename );
     }
 #endif
 
@@ -2897,7 +2923,7 @@
 if(eof == PT_NEXT_ENTRY || eof == PT_PREV_ENTRY) {
   eof = eof == PT_NEXT_ENTRY ? 1 : -1;
   if(play_tree_iter_step(playtree_iter,eof,0) == PLAY_TREE_ITER_ENTRY) {
-    uninit_player(INITED_ALL-(INITED_GUI+INITED_LIRC+INITED_INPUT));
+    uninit_player(INITED_ALL-(INITED_GUI+INITED_LIRC+INITED_INPUT+INITED_VO));
     eof = 1;
   } else {
     play_tree_iter_free(playtree_iter);
@@ -2906,17 +2932,19 @@
 } else if (eof == PT_UP_NEXT || eof == PT_UP_PREV) {
   eof = eof == PT_UP_NEXT ? 1 : -1;
   if(play_tree_iter_up_step(playtree_iter,eof,0) == PLAY_TREE_ITER_ENTRY) {
-    uninit_player(INITED_ALL-(INITED_GUI+INITED_LIRC+INITED_INPUT));
+    uninit_player(INITED_ALL-(INITED_GUI+INITED_LIRC+INITED_INPUT+INITED_VO));
     eof = 1;
   } else {
     play_tree_iter_free(playtree_iter);
     playtree_iter = NULL;
   }
 }else { // NEXT PREV SRC
-     uninit_player(INITED_ALL-(INITED_GUI+INITED_LIRC+INITED_INPUT));
+     uninit_player(INITED_ALL-(INITED_GUI+INITED_LIRC+INITED_INPUT+INITED_VO));
      eof = eof == PT_PREV_SRC ? -1 : 1;
 }
 
+uninit_player(INITED_VO);
+
 if(eof == 0) eof = 1;
 
 #ifdef HAVE_NEW_GUI
@@ -2942,13 +2970,13 @@
 
 if(use_gui || playtree_iter != NULL
 #if defined( HAVE_NEW_GUI ) && defined( USE_DVDREAD )
- || guiIntfStruct.DVDChanged
+ || ( guiIntfStruct.DVDChanged && use_gui )
 #endif 
 ){
 
   current_module="uninit_vcodec";
   if(sh_video) uninit_video(sh_video);
-
+  
   current_module="free_demuxer";
   if(demuxer) free_demuxer(demuxer);
 




More information about the MPlayer-cvslog mailing list