[Mplayer-cvslog] CVS: main mplayer.c,1.241,1.242
Arpi of Ize
arpi at mplayer.dev.hu
Tue Aug 28 01:56:45 CEST 2001
Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv28362
Modified Files:
mplayer.c
Log Message:
GUI stuff. now seeking works, and xmga renders to video window
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.241
retrieving revision 1.242
diff -u -r1.241 -r1.242
--- mplayer.c 27 Aug 2001 00:54:54 -0000 1.241
+++ mplayer.c 27 Aug 2001 23:56:43 -0000 1.242
@@ -37,6 +37,7 @@
#include "libvo2/libvo2.h"
#else
#include "libvo/video_out.h"
+void* mDisplay; // Display* mDisplay;
#endif
//#ifdef USE_OSD
@@ -185,6 +186,8 @@
static int play_in_bg=0;
+extern float gui_position;
+
extern void avi_fixate();
#ifdef HAVE_GUI
@@ -274,44 +277,17 @@
int sub_auto = 1;
/*DSP!!char *dsp=NULL;*/
-//float rel_seek_secs=0;
//float initial_pts_delay=0;
+float rel_seek_secs=0;
+int abs_seek_pos=0;
+
extern char *vo_subdevice;
extern char *ao_subdevice;
void exit_player(char* how){
total_time_usage_start=GetTimer()-total_time_usage_start;
-#ifdef HAVE_GUI
- if ( !nogui )
- {
- if ( how != NULL )
- {
- if ( !strcmp( how,"Quit" ) ) mplSendMessage( mplEndOfFile );
- if ( !strcmp( how,"End of file" ) ) mplSendMessage( mplEndOfFile );
- if ( !strcmp( how,"audio_init" ) ) mplSendMessage( mplAudioError );
- }
- else mplSendMessage( mplUnknowError );
- }
-#endif
-
- if(how) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_Exiting,how);
- mp_msg(MSGT_CPLAYER,MSGL_V,"max framesize was %d bytes\n",max_framesize);
- if(benchmark){
- double tot=video_time_usage+vout_time_usage+audio_time_usage;
- double total_time_usage=(float)total_time_usage_start*0.000001;
- mp_msg(MSGT_CPLAYER,MSGL_INFO,"BENCHMARKs: V:%8.3fs VO:%8.3fs A:%8.3fs Sys:%8.3fs = %8.3fs\n",
- video_time_usage,vout_time_usage,audio_time_usage,
- total_time_usage-tot,total_time_usage);
- if(total_time_usage>0.0)
- mp_msg(MSGT_CPLAYER,MSGL_INFO,"BENCHMARK%%: V:%8.4f%% VO:%8.4f%% A:%8.4f%% Sys:%8.4f%% = %8.4f%%\n",
- 100.0*video_time_usage/total_time_usage,
- 100.0*vout_time_usage/total_time_usage,
- 100.0*audio_time_usage/total_time_usage,
- 100.0*(total_time_usage-tot)/total_time_usage,
- 100.0);
- }
// restore terminal:
#ifdef HAVE_GUI
if ( nogui )
@@ -323,7 +299,13 @@
#else
if(video_out) video_out->uninit();
#endif
+
+#ifdef HAVE_NEW_GUI
+ if(use_gui) mplDone();
+#endif
+
if(audio_out) audio_out->uninit();
+
if(encode_name) avi_fixate();
#ifdef HAVE_LIRC
#ifdef HAVE_GUI
@@ -332,6 +314,23 @@
lirc_mp_cleanup();
#endif
+ if(how) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_Exiting,how);
+ mp_msg(MSGT_CPLAYER,MSGL_V,"max framesize was %d bytes\n",max_framesize);
+ if(benchmark){
+ double tot=video_time_usage+vout_time_usage+audio_time_usage;
+ double total_time_usage=(float)total_time_usage_start*0.000001;
+ mp_msg(MSGT_CPLAYER,MSGL_INFO,"BENCHMARKs: V:%8.3fs VO:%8.3fs A:%8.3fs Sys:%8.3fs = %8.3fs\n",
+ video_time_usage,vout_time_usage,audio_time_usage,
+ total_time_usage-tot,total_time_usage);
+ if(total_time_usage>0.0)
+ mp_msg(MSGT_CPLAYER,MSGL_INFO,"BENCHMARK%%: V:%8.4f%% VO:%8.4f%% A:%8.4f%% Sys:%8.4f%% = %8.4f%%\n",
+ 100.0*video_time_usage/total_time_usage,
+ 100.0*vout_time_usage/total_time_usage,
+ 100.0*audio_time_usage/total_time_usage,
+ 100.0*(total_time_usage-tot)/total_time_usage,
+ 100.0);
+ }
+
exit(1);
}
@@ -454,9 +453,6 @@
//float a_frame=0; // Audio
-float rel_seek_secs=0;
-int abs_seek_pos=0;
-
int i;
int use_stdin=0; //int f; // filedes
@@ -480,9 +476,13 @@
mp_msg(MSGT_CPLAYER,MSGL_WARN,"MPlayer was compiled WITHOUT GUI support!\n");
use_gui=0;
}
+#else
+ if(use_gui && !vo_init()){
+ mp_msg(MSGT_CPLAYER,MSGL_WARN,"MPlayer GUI requires X11!\n");
+ use_gui=0;
+ }
#endif
-
#ifndef USE_LIBVO2
if(video_driver && strcmp(video_driver,"help")==0){
printf("Available video output drivers:\n");
@@ -560,7 +560,7 @@
// It's time to init the GUI code: (and fork() the GTK process)
#ifdef HAVE_NEW_GUI
if(use_gui){
- appInit( argc,argv,envp );
+ appInit( argc,argv,envp,(void*)mDisplay );
}
#endif
@@ -1778,6 +1778,17 @@
abs_seek_pos=0;
current_module=NULL;
}
+
+#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;
+ }
+#endif
+
//================= Update OSD ====================
#ifdef USE_OSD
More information about the MPlayer-cvslog
mailing list