Mercurial > mplayer.hg
comparison mplayer.c @ 1156:5dc01778e055
has_audio checkings at reset and exit added
author | al3x |
---|---|
date | Mon, 18 Jun 2001 14:19:13 +0000 |
parents | 3ec8f4779e81 |
children | f2516027a346 |
comparison
equal
deleted
inserted
replaced
1155:be5942e385e5 | 1156:5dc01778e055 |
---|---|
296 #define GUI_MSG(x) if ( !nogui ) { mplSendMessage( x ); usec_sleep( 10000 ); } | 296 #define GUI_MSG(x) if ( !nogui ) { mplSendMessage( x ); usec_sleep( 10000 ); } |
297 #else | 297 #else |
298 #define GUI_MSG(x) | 298 #define GUI_MSG(x) |
299 #endif | 299 #endif |
300 | 300 |
301 // options: | |
302 int osd_level=2; | |
303 int divx_quality=0; | |
304 char *seek_to_sec=NULL; | |
305 int seek_to_byte=0; | |
306 int has_audio=1; | |
307 //int has_video=1; | |
308 int audio_format=0; // override | |
309 | |
310 #ifdef USE_DIRECTSHOW | |
311 int allow_dshow=1; | |
312 #else | |
313 int allow_dshow=0; | |
314 #endif | |
315 | |
316 //#ifdef ALSA_TIMER | |
317 //int alsa=1; | |
318 //#else | |
319 //int alsa=0; | |
320 //#endif | |
321 | |
322 // streaming: | |
323 int audio_id=-1; | |
324 int video_id=-1; | |
325 int dvdsub_id=-1; | |
326 int vcd_track=0; | |
327 char *stream_dump_name=NULL; | |
328 int stream_dump_type=0; | |
329 int index_mode=-1; // -1=untouched 0=don't use index 1=use (geneate) index | |
330 int force_ni=0; | |
331 | |
332 float default_max_pts_correction=-1;//0.01f; | |
333 #ifdef AVI_SYNC_BPS | |
334 int pts_from_bps=1; | |
335 #else | |
336 int pts_from_bps=0; | |
337 #endif | |
338 | |
339 float force_fps=0; | |
340 int force_srate=0; | |
341 float audio_delay=0; | |
342 int frame_dropping=0; // option 0=no drop 1= drop vo 2= drop decode | |
343 int play_n_frames=-1; | |
344 | |
345 // screen info: | |
346 char* video_driver=NULL; //"mga"; // default | |
347 char* audio_driver=NULL; | |
348 int fullscreen=0; | |
349 int vidmode=0; | |
350 int softzoom=0; | |
351 int flip=-1; | |
352 int screen_size_x=0;//SCREEN_SIZE_X; | |
353 int screen_size_y=0;//SCREEN_SIZE_Y; | |
354 int screen_size_xy=0; | |
355 | |
356 // sub: | |
357 char *font_name=NULL; | |
358 float font_factor=0.75; | |
359 char *sub_name=NULL; | |
360 float sub_delay=0; | |
361 float sub_fps=0; | |
362 int sub_auto = 1; | |
363 char *dsp=NULL; | |
364 | |
365 float rel_seek_secs=0; | |
366 | |
367 | |
301 void exit_player(char* how){ | 368 void exit_player(char* how){ |
302 | |
303 total_time_usage_start=GetTimer()-total_time_usage_start; | 369 total_time_usage_start=GetTimer()-total_time_usage_start; |
304 | 370 |
305 #ifdef HAVE_GUI | 371 #ifdef HAVE_GUI |
306 if ( !nogui ) | 372 if ( !nogui ) |
307 { | 373 { |
334 // restore terminal: | 400 // restore terminal: |
335 #ifdef HAVE_GUI | 401 #ifdef HAVE_GUI |
336 if ( nogui ) | 402 if ( nogui ) |
337 #endif | 403 #endif |
338 getch2_disable(); | 404 getch2_disable(); |
339 video_out->uninit(); | 405 if(video_out) video_out->uninit(); |
340 // audio_out->reset(); | 406 if(audio_out && has_audio) audio_out->uninit(); |
341 if(audio_out) audio_out->uninit(); | |
342 if(encode_name) avi_fixate(); | 407 if(encode_name) avi_fixate(); |
343 #ifdef HAVE_LIRC | 408 #ifdef HAVE_LIRC |
344 #ifdef HAVE_GUI | 409 #ifdef HAVE_GUI |
345 if ( nogui ) | 410 if ( nogui ) |
346 #endif | 411 #endif |
379 extern void mpeg2_allocate_image_buffers(picture_t * picture); | 444 extern void mpeg2_allocate_image_buffers(picture_t * picture); |
380 extern void write_avi_header_1(FILE *f,int fcc,float fps,int width,int height); | 445 extern void write_avi_header_1(FILE *f,int fcc,float fps,int width,int height); |
381 extern int vo_init(void); | 446 extern int vo_init(void); |
382 extern int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen); | 447 extern int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen); |
383 | 448 |
384 // options: | |
385 int osd_level=2; | |
386 int divx_quality=0; | |
387 char *seek_to_sec=NULL; | |
388 int seek_to_byte=0; | |
389 int has_audio=1; | |
390 //int has_video=1; | |
391 int audio_format=0; // override | |
392 | |
393 #ifdef USE_DIRECTSHOW | |
394 int allow_dshow=1; | |
395 #else | |
396 int allow_dshow=0; | |
397 #endif | |
398 | |
399 //#ifdef ALSA_TIMER | |
400 //int alsa=1; | |
401 //#else | |
402 //int alsa=0; | |
403 //#endif | |
404 | |
405 // streaming: | |
406 int audio_id=-1; | |
407 int video_id=-1; | |
408 int dvdsub_id=-1; | |
409 int vcd_track=0; | |
410 char *stream_dump_name=NULL; | |
411 int stream_dump_type=0; | |
412 int index_mode=-1; // -1=untouched 0=don't use index 1=use (geneate) index | |
413 int force_ni=0; | |
414 | |
415 float default_max_pts_correction=-1;//0.01f; | |
416 #ifdef AVI_SYNC_BPS | |
417 int pts_from_bps=1; | |
418 #else | |
419 int pts_from_bps=0; | |
420 #endif | |
421 | |
422 float force_fps=0; | |
423 int force_srate=0; | |
424 float audio_delay=0; | |
425 int frame_dropping=0; // option 0=no drop 1= drop vo 2= drop decode | |
426 int play_n_frames=-1; | |
427 | |
428 // screen info: | |
429 char* video_driver=NULL; //"mga"; // default | |
430 char* audio_driver=NULL; | |
431 int fullscreen=0; | |
432 int vidmode=0; | |
433 int softzoom=0; | |
434 int flip=-1; | |
435 int screen_size_x=0;//SCREEN_SIZE_X; | |
436 int screen_size_y=0;//SCREEN_SIZE_Y; | |
437 int screen_size_xy=0; | |
438 | |
439 // sub: | |
440 char *font_name=NULL; | |
441 float font_factor=0.75; | |
442 char *sub_name=NULL; | |
443 float sub_delay=0; | |
444 float sub_fps=0; | |
445 int sub_auto = 1; | |
446 | |
447 char *dsp=NULL; | |
448 | |
449 float rel_seek_secs=0; | |
450 | 449 |
451 #include "mixer.h" | 450 #include "mixer.h" |
452 #include "cfg-mplayer.h" | 451 #include "cfg-mplayer.h" |
453 | 452 |
454 void parse_cfgfiles( void ) | 453 void parse_cfgfiles( void ) |
1940 if(!osd_visible) vo_osd_progbar_type=-1; // disable | 1939 if(!osd_visible) vo_osd_progbar_type=-1; // disable |
1941 } | 1940 } |
1942 | 1941 |
1943 if(osd_function==OSD_PAUSE){ | 1942 if(osd_function==OSD_PAUSE){ |
1944 printf("\n------ PAUSED -------\r");fflush(stdout); | 1943 printf("\n------ PAUSED -------\r");fflush(stdout); |
1945 audio_out->pause(); // pause audio, keep data if possible | 1944 if (audio_out && has_audio) |
1945 audio_out->pause(); // pause audio, keep data if possible | |
1946 #ifdef HAVE_GUI | 1946 #ifdef HAVE_GUI |
1947 if ( nogui ) | 1947 if ( nogui ) |
1948 { | 1948 { |
1949 #endif | 1949 #endif |
1950 while( | 1950 while( |
1957 } | 1957 } |
1958 osd_function=OSD_PLAY; | 1958 osd_function=OSD_PLAY; |
1959 #ifdef HAVE_GUI | 1959 #ifdef HAVE_GUI |
1960 } else while( osd_function != OSD_PLAY ) usec_sleep( 1000 ); | 1960 } else while( osd_function != OSD_PLAY ) usec_sleep( 1000 ); |
1961 #endif | 1961 #endif |
1962 audio_out->resume(); // resume audio | 1962 if (audio_out && has_audio) |
1963 audio_out->resume(); // resume audio | |
1963 } | 1964 } |
1964 | 1965 |
1965 | 1966 |
1966 if(!force_redraw) break; | 1967 if(!force_redraw) break; |
1967 } // while(v_frame<a_frame || force_redraw) | 1968 } // while(v_frame<a_frame || force_redraw) |