summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-10 09:13:36 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-10 09:13:36 +0000
commitdcbbd60bc2e0f2ad873fde3e2379d28189552001 (patch)
treeb5e3f0e0dbad533162b840e0deb426d3e8d47bf2 /mplayer.c
parent46b1cf318d426013c93f4ba0b50280208e5a126d (diff)
downloadmpv-dcbbd60bc2e0f2ad873fde3e2379d28189552001.tar.bz2
mpv-dcbbd60bc2e0f2ad873fde3e2379d28189552001.tar.xz
stime compile bug fixed. and GUI_MSG macro defined.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@749 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c74
1 files changed, 22 insertions, 52 deletions
diff --git a/mplayer.c b/mplayer.c
index 7a75aaad1b..e787125f1f 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -14,6 +14,7 @@
#include <sys/ioctl.h>
#include <unistd.h>
+#include <time.h>
#include <sys/mman.h>
#include <sys/types.h>
@@ -89,7 +90,7 @@ extern int errno;
#define DEBUG if(0)
#ifdef HAVE_GUI
- int nogui=1; // new
+ int nogui=1;
#endif
int verbose=0;
@@ -354,6 +355,9 @@ extern void avi_fixate();
#ifdef HAVE_GUI
#include "../Gui/mplayer/psignal.h"
+ #define GUI_MSG(x) if ( !nogui ) { mplSendMessage( x ); usleep( 10000 ); }
+#else
+ #define GUI_MSG(x)
#endif
void exit_player(char* how){
@@ -583,9 +587,7 @@ if(!filename){
// check codec.conf
if(!parse_codec_cfg(get_path("codecs.conf"))){
printf("(copy/link DOCS/codecs.conf to ~/.mplayer/codecs.conf)\n");
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplCodecConfNotFound ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplCodecConfNotFound )
exit(1);
}
@@ -651,18 +653,14 @@ if(vcd_track){
if (dvdimportkey) {
if (dvd_import_key(dvdimportkey)) {
fprintf(stderr,"Error processing DVD KEY.\n");
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplErrorDVDKeyProcess ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplErrorDVDKeyProcess )
exit(1);
}
printf("DVD command line requested key is stored for descrambling.\n");
}
if (dvd_device) {
if (dvd_auth(dvd_device,f)) {
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplErrorDVDAuth ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplErrorDVDAuth )
exit(0);
}
printf("DVD auth sequence seems to be OK.\n");
@@ -739,9 +737,7 @@ if(file_format==DEMUXER_TYPE_MPEG_ES){ // little hack, see above!
if(file_format==DEMUXER_TYPE_UNKNOWN){
printf("============= Sorry, this file format not recognized/supported ===============\n");
printf("=== If this file is an AVI, ASF or MPEG stream, please contact the author! ===\n");
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplUnknowFileType ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplUnknowFileType )
exit(1);
}
//====== File format recognized, set up these for compatibility: =========
@@ -792,9 +788,7 @@ switch(file_format){
}
if(v_pos==-1){
printf("AVI_NI: missing video stream!? contact the author, it may be a bug :(\n");
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplErrorAVINI ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplErrorAVINI )
exit(1);
}
if(a_pos==-1){
@@ -819,9 +813,7 @@ switch(file_format){
}
if(!ds_fill_buffer(d_video)){
printf("AVI: missing video stream!? contact the author, it may be a bug :(\n");
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplAVIErrorMissingVideoStream ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplAVIErrorMissingVideoStream )
exit(1);
}
sh_video=d_video->sh;sh_video->ds=d_video;
@@ -863,9 +855,7 @@ switch(file_format){
// demuxer->endpos=avi_header.movi_end;
if(!ds_fill_buffer(d_video)){
printf("ASF: missing video stream!? contact the author, it may be a bug :(\n");
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplASFErrorMissingVideoStream ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplASFErrorMissingVideoStream )
exit(1);
}
sh_video=d_video->sh;sh_video->ds=d_video;
@@ -934,9 +924,7 @@ switch(file_format){
if(!i || !skip_video_packet(d_video)){
if(verbose) printf("NONE :(\n");
printf("MPEG: FATAL: EOF while searching for sequence header\n");
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplMPEGErrorSeqHeaderSearch ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplMPEGErrorSeqHeaderSearch )
exit(1);
}
}
@@ -948,40 +936,30 @@ switch(file_format){
videobuffer=shmem_alloc(VIDEOBUFFER_SIZE);
if(!videobuffer){
printf("Cannot allocate shared memory\n");
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplErrorShMemAlloc ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplErrorShMemAlloc )
exit(0);
}
videobuf_len=0;
if(!read_video_packet(d_video)){
printf("FATAL: Cannot read sequence header!\n");
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplMPEGErrorCannotReadSeqHeader ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplMPEGErrorCannotReadSeqHeader )
exit(1);
}
if(header_process_sequence_header (picture, &videobuffer[4])) {
printf ("bad sequence header!\n");
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplMPEGErrorBadSeqHeader ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplMPEGErrorBadSeqHeader )
exit(1);
}
if(sync_video_packet(d_video)==0x1B5){ // next packet is seq. ext.
videobuf_len=0;
if(!read_video_packet(d_video)){
printf("FATAL: Cannot read sequence header extension!\n");
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplMPEGErrorCannotReadSeqHeaderExt ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplMPEGErrorCannotReadSeqHeaderExt )
exit(1);
}
if(header_process_extension (picture, &videobuffer[4])) {
printf ("bad sequence header extension!\n");
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplMPEGErrorBadSeqHeaderExt ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplMPEGErrorBadSeqHeaderExt )
exit(1);
}
}
@@ -1095,9 +1073,7 @@ for(i=0;i<CODECS_MAX_OUTFMT;i++){
}
if(i>=CODECS_MAX_OUTFMT){
printf("Sorry, selected video_out device is incompatible with this codec.\n");
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplIncompatibleVideoOutDevice ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplIncompatibleVideoOutDevice )
exit(1);
}
sh_video->outfmtidx=i;
@@ -1107,9 +1083,7 @@ if(verbose) printf("vo_debug1: out_fmt=0x%08X\n",out_fmt);
switch(sh_video->codec->driver){
case 2: {
if(!init_video_codec(sh_video)) {
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplUnknowError ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplUnknowError )
exit(1);
}
if(verbose) printf("INFO: Win32 video codec init OK!\n");
@@ -1118,9 +1092,7 @@ switch(sh_video->codec->driver){
case 4: { // Win32/DirectShow
#ifndef USE_DIRECTSHOW
printf("MPlayer was compiled WITHOUT directshow support!\n");
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplCompileWithoutDSSupport ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplCompileWithoutDSSupport )
exit(1);
#else
sh_video->our_out_buffer=NULL;
@@ -1294,9 +1266,7 @@ if(verbose) printf("vo_debug3: out_fmt=0x%08X\n",out_fmt);
fullscreen|(vidmode<<1)|(softzoom<<2),
title,out_fmt)){
printf("FATAL: Cannot initialize video driver!\n");
- #ifdef HAVE_GUI
- if ( !nogui ) { mplSendMessage( mplCantInitVideoDriver ); usleep( 10000 ); }
- #endif
+ GUI_MSG( mplCantInitVideoDriver )
exit(1);
}
if(verbose) printf("INFO: Video OUT driver init OK!\n");