[Mplayer-cvslog] CVS: main mplayer.c,1.245,1.246

Zoltan Ponekker pontscho at mplayer.dev.hu
Tue Aug 28 17:50:11 CEST 2001


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

Modified Files:
	mplayer.c 
Log Message:
fix hprogressbar

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.245
retrieving revision 1.246
diff -u -r1.245 -r1.246
--- mplayer.c	28 Aug 2001 14:22:37 -0000	1.245
+++ mplayer.c	28 Aug 2001 15:50:08 -0000	1.246
@@ -66,11 +66,11 @@
 #include "lirc_mp.h"
 #endif
 
+#ifdef HAVE_NEW_GUI
+#include "Gui/mplayer/play.h"
+#endif
 
 #define DEBUG if(0)
-#ifdef HAVE_GUI
- int nogui=1;
-#endif
 int verbose=0;
 int quiet=0;
 
@@ -190,13 +190,6 @@
 
 extern void avi_fixate();
 
-#ifdef HAVE_GUI
- #include "../Gui/mplayer/psignal.h"
- #define GUI_MSG(x) if ( !nogui ) { mplSendMessage( x ); usec_sleep( 10000 ); }
-#else
- #define GUI_MSG(x)
-#endif
-
 // options:
 
 int divx_quality=0;
@@ -289,10 +282,12 @@
  total_time_usage_start=GetTimer()-total_time_usage_start;
 
   // restore terminal:
-  #ifdef HAVE_GUI
-   if ( nogui )
-  #endif
-     getch2_disable();
+#ifdef HAVE_NEW_GUI
+   if ( !use_gui ) getch2_disable();
+#else
+   getch2_disable();
+#endif
+     
 
 #ifdef USE_LIBVO2
   if(video_out) vo2_close(video_out);
@@ -308,9 +303,6 @@
 
   if(encode_name) avi_fixate();
 #ifdef HAVE_LIRC
-  #ifdef HAVE_GUI
-   if ( nogui )
-  #endif
   lirc_mp_cleanup();
 #endif
 
@@ -347,13 +339,6 @@
   mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_IntBySignal,x,
       current_module?current_module:"unknown"
   );
-  #ifdef HAVE_GUI
-   if ( !nogui )
-    {
-     mplShMem->items.error.signal=x;
-     strcpy( mplShMem->items.error.module,current_module?current_module:"unknown" );
-    }
-  #endif
   exit_player(NULL);
 }
 
@@ -408,11 +393,11 @@
 }
 }
 
-#ifndef HAVE_GUI
+//ifndef HAVE_GUI
  int main(int argc,char* argv[], char *envp[]){
-#else
- int mplayer(int argc,char* argv[], char *envp[]){
-#endif
+//else
+// int mplayer(int argc,char* argv[], char *envp[]){
+//endif
 
 #ifdef USE_SUB
 static subtitle* subtitles=NULL;
@@ -565,14 +550,11 @@
 #endif
 
 #ifdef HAVE_LIRC
- #ifdef HAVE_GUI
-  if ( nogui )
- #endif
   lirc_mp_setup();
 #endif
 
 #ifdef USE_TERMCAP
-  load_termcap(NULL); // load key-codes
+  if ( !use_gui ) load_termcap(NULL); // load key-codes
 #endif
 
 
@@ -581,10 +563,7 @@
   signal(SIGTERM,exit_sighandler); // kill
   signal(SIGHUP,exit_sighandler);  // kill -HUP  /  xterm closed
 
-  #ifdef HAVE_GUI
-   if ( nogui )
-  #endif
-     signal(SIGINT,exit_sighandler);  // Interrupt from keyboard
+  signal(SIGINT,exit_sighandler);  // Interrupt from keyboard
 
   signal(SIGQUIT,exit_sighandler); // Quit from keyboard
   // fatal errors:
@@ -985,15 +964,6 @@
                       fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3),
                       title,out_fmt);
 
-   #ifdef HAVE_GUI
-    if ( !nogui )
-     {
-      mplShMem->items.videodata.width=sh_video->disp_w;
-      mplShMem->items.videodata.height=sh_video->disp_h;
-      mplSendMessage( mplSetVideoData );
-     }
-   #endif
-
 #ifdef USE_LIBVO2
    if(!vo2_start(video_out,
                sh_video->disp_w,sh_video->disp_h,out_fmt,0,
@@ -1294,12 +1264,12 @@
 	      mp_msg(MSGT_AVSYNC,MSGL_DBG2,"\nstill dropping, %.2f\n", time_frame);
 	  }
       }
-      video_out->check_events(); // check events AST
 #ifdef HAVE_NEW_GUI
       if(use_gui){
         wsHandleEvents();mplTimerHandler(0); // handle GUI timer events
       }
 #endif
+      video_out->check_events(); // check events AST
     } else {
       // It's time to sleep...
       current_module="sleep";
@@ -1504,10 +1474,6 @@
       mp_msg(MSGT_CPLAYER,MSGL_STATUS,"\n------ PAUSED -------\r");fflush(stdout);
       if (audio_out && sh_audio)
          audio_out->pause();	// pause audio, keep data if possible
-#ifdef HAVE_GUI
-      if ( nogui )
-        {
-#endif
          while(
 #ifdef HAVE_LIRC
              lirc_mp_getinput()<=0 &&
@@ -1524,9 +1490,6 @@
              if(use_stdin) usec_sleep(1000); // do not eat the CPU
          }
          osd_function=OSD_PLAY;
-#ifdef HAVE_GUI
-        } else while( osd_function != OSD_PLAY ) usec_sleep( 1000 );
-#endif
       if (audio_out && sh_audio)
         audio_out->resume();	// resume audio
   }
@@ -1781,11 +1744,14 @@
 
 #ifdef HAVE_NEW_GUI
       if(use_gui){
-        int len=((demuxer->movi_end-demuxer->movi_start)>>8);
-        if(len>0)
-          gui_position=(demuxer->filepos-demuxer->movi_start)/len;
-        else
-	  gui_position=-1;
+        int len=((demuxer->movi_end-demuxer->movi_start));
+//        if(len>0)
+//          gui_position=(float)(demuxer->filepos-demuxer->movi_start)/len;
+//        else
+//	  gui_position=-1;
+	if ( len > 0 ) mplShMem->Position=(float)(demuxer->filepos-demuxer->movi_start) / len * 100.0f;
+	 else mplShMem->Position=0;
+	mplShMem->TimeSec=d_video->pts; 
       }
 #endif
 
@@ -1842,10 +1808,11 @@
     // partial uninit:
 
   // restore terminal:
-  #ifdef HAVE_GUI
-   if ( nogui )
-  #endif
-     getch2_disable();
+#ifdef HAVE_NEW_GUI
+   if ( !use_gui ) getch2_disable();
+#else
+   getch2_disable();
+#endif
 
   current_module="uninit_vo";
 




More information about the MPlayer-cvslog mailing list