summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authoral3x <al3x@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-06-18 14:19:13 +0000
committeral3x <al3x@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-06-18 14:19:13 +0000
commit17743e35e836f1239f1b0f569389aa98b0e0f47f (patch)
tree7b20ae35c1da4b4313564b48804cf7725e255a8b /mplayer.c
parente10baf6ffbe6d9fe58b8d11e1357fe4d51f8e0b2 (diff)
downloadmpv-17743e35e836f1239f1b0f569389aa98b0e0f47f.tar.bz2
mpv-17743e35e836f1239f1b0f569389aa98b0e0f47f.tar.xz
has_audio checkings at reset and exit added
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1157 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c145
1 files changed, 73 insertions, 72 deletions
diff --git a/mplayer.c b/mplayer.c
index 6add72b08b..fd643ac834 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -298,8 +298,74 @@ extern void avi_fixate();
#define GUI_MSG(x)
#endif
-void exit_player(char* how){
+// options:
+int osd_level=2;
+int divx_quality=0;
+char *seek_to_sec=NULL;
+int seek_to_byte=0;
+int has_audio=1;
+//int has_video=1;
+int audio_format=0; // override
+
+#ifdef USE_DIRECTSHOW
+int allow_dshow=1;
+#else
+int allow_dshow=0;
+#endif
+
+//#ifdef ALSA_TIMER
+//int alsa=1;
+//#else
+//int alsa=0;
+//#endif
+
+// streaming:
+int audio_id=-1;
+int video_id=-1;
+int dvdsub_id=-1;
+int vcd_track=0;
+char *stream_dump_name=NULL;
+int stream_dump_type=0;
+int index_mode=-1; // -1=untouched 0=don't use index 1=use (geneate) index
+int force_ni=0;
+
+float default_max_pts_correction=-1;//0.01f;
+#ifdef AVI_SYNC_BPS
+int pts_from_bps=1;
+#else
+int pts_from_bps=0;
+#endif
+
+float force_fps=0;
+int force_srate=0;
+float audio_delay=0;
+int frame_dropping=0; // option 0=no drop 1= drop vo 2= drop decode
+int play_n_frames=-1;
+
+// screen info:
+char* video_driver=NULL; //"mga"; // default
+char* audio_driver=NULL;
+int fullscreen=0;
+int vidmode=0;
+int softzoom=0;
+int flip=-1;
+int screen_size_x=0;//SCREEN_SIZE_X;
+int screen_size_y=0;//SCREEN_SIZE_Y;
+int screen_size_xy=0;
+
+// sub:
+char *font_name=NULL;
+float font_factor=0.75;
+char *sub_name=NULL;
+float sub_delay=0;
+float sub_fps=0;
+int sub_auto = 1;
+char *dsp=NULL;
+
+float rel_seek_secs=0;
+
+void exit_player(char* how){
total_time_usage_start=GetTimer()-total_time_usage_start;
#ifdef HAVE_GUI
@@ -336,9 +402,8 @@ void exit_player(char* how){
if ( nogui )
#endif
getch2_disable();
- video_out->uninit();
-// audio_out->reset();
- if(audio_out) audio_out->uninit();
+ if(video_out) video_out->uninit();
+ if(audio_out && has_audio) audio_out->uninit();
if(encode_name) avi_fixate();
#ifdef HAVE_LIRC
#ifdef HAVE_GUI
@@ -381,72 +446,6 @@ extern void write_avi_header_1(FILE *f,int fcc,float fps,int width,int height);
extern int vo_init(void);
extern int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen);
-// options:
-int osd_level=2;
-int divx_quality=0;
-char *seek_to_sec=NULL;
-int seek_to_byte=0;
-int has_audio=1;
-//int has_video=1;
-int audio_format=0; // override
-
-#ifdef USE_DIRECTSHOW
-int allow_dshow=1;
-#else
-int allow_dshow=0;
-#endif
-
-//#ifdef ALSA_TIMER
-//int alsa=1;
-//#else
-//int alsa=0;
-//#endif
-
-// streaming:
-int audio_id=-1;
-int video_id=-1;
-int dvdsub_id=-1;
-int vcd_track=0;
-char *stream_dump_name=NULL;
-int stream_dump_type=0;
-int index_mode=-1; // -1=untouched 0=don't use index 1=use (geneate) index
-int force_ni=0;
-
-float default_max_pts_correction=-1;//0.01f;
-#ifdef AVI_SYNC_BPS
-int pts_from_bps=1;
-#else
-int pts_from_bps=0;
-#endif
-
-float force_fps=0;
-int force_srate=0;
-float audio_delay=0;
-int frame_dropping=0; // option 0=no drop 1= drop vo 2= drop decode
-int play_n_frames=-1;
-
-// screen info:
-char* video_driver=NULL; //"mga"; // default
-char* audio_driver=NULL;
-int fullscreen=0;
-int vidmode=0;
-int softzoom=0;
-int flip=-1;
-int screen_size_x=0;//SCREEN_SIZE_X;
-int screen_size_y=0;//SCREEN_SIZE_Y;
-int screen_size_xy=0;
-
-// sub:
-char *font_name=NULL;
-float font_factor=0.75;
-char *sub_name=NULL;
-float sub_delay=0;
-float sub_fps=0;
-int sub_auto = 1;
-
-char *dsp=NULL;
-
-float rel_seek_secs=0;
#include "mixer.h"
#include "cfg-mplayer.h"
@@ -1942,7 +1941,8 @@ switch(sh_video->codec->driver){
if(osd_function==OSD_PAUSE){
printf("\n------ PAUSED -------\r");fflush(stdout);
- audio_out->pause(); // pause audio, keep data if possible
+ if (audio_out && has_audio)
+ audio_out->pause(); // pause audio, keep data if possible
#ifdef HAVE_GUI
if ( nogui )
{
@@ -1959,7 +1959,8 @@ switch(sh_video->codec->driver){
#ifdef HAVE_GUI
} else while( osd_function != OSD_PLAY ) usec_sleep( 1000 );
#endif
- audio_out->resume(); // resume audio
+ if (audio_out && has_audio)
+ audio_out->resume(); // resume audio
}