Mercurial > mplayer.hg
comparison mplayer.c @ 1014:e01dc1a88edf
fixed punkso's mess... local variables moved back to main()
author | arpi_esp |
---|---|
date | Tue, 05 Jun 2001 00:58:51 +0000 |
parents | c51d7e4853d6 |
children | 9744b50fe87f |
comparison
equal
deleted
inserted
replaced
1013:74d55f3c4680 | 1014:e01dc1a88edf |
---|---|
381 } | 381 } |
382 #endif | 382 #endif |
383 exit_player(NULL); | 383 exit_player(NULL); |
384 } | 384 } |
385 | 385 |
386 int divx_quality=0; | |
387 | |
388 extern int vcd_get_track_end(int fd,int track); | 386 extern int vcd_get_track_end(int fd,int track); |
389 extern int init_audio(sh_audio_t *sh_audio); | 387 extern int init_audio(sh_audio_t *sh_audio); |
390 extern int init_video_codec(sh_video_t *sh_video); | 388 extern int init_video_codec(sh_video_t *sh_video); |
391 extern void mpeg2_allocate_image_buffers(picture_t * picture); | 389 extern void mpeg2_allocate_image_buffers(picture_t * picture); |
392 extern void write_avi_header_1(FILE *f,int fcc,float fps,int width,int height); | 390 extern void write_avi_header_1(FILE *f,int fcc,float fps,int width,int height); |
393 extern int vo_init(void); | 391 extern int vo_init(void); |
394 extern int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen); | 392 extern int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen); |
395 | 393 |
396 char* filename=NULL; //"MI2-Trailer.avi"; | 394 // options: |
397 int i; | 395 int divx_quality=0; |
398 char *seek_to_sec=NULL; | 396 char *seek_to_sec=NULL; |
399 int seek_to_byte=0; | 397 int seek_to_byte=0; |
400 int f; // filedes | |
401 stream_t* stream=NULL; | |
402 int file_format=DEMUXER_TYPE_UNKNOWN; | |
403 int has_audio=1; | 398 int has_audio=1; |
404 //int has_video=1; | 399 //int has_video=1; |
405 // | |
406 int audio_format=0; // override | 400 int audio_format=0; // override |
401 | |
407 #ifdef USE_DIRECTSHOW | 402 #ifdef USE_DIRECTSHOW |
408 int allow_dshow=1; | 403 int allow_dshow=1; |
409 #else | 404 #else |
410 int allow_dshow=0; | 405 int allow_dshow=0; |
411 #endif | 406 #endif |
412 #ifdef ALSA_TIMER | 407 |
413 int alsa=1; | 408 //#ifdef ALSA_TIMER |
414 #else | 409 //int alsa=1; |
415 int alsa=0; | 410 //#else |
416 #endif | 411 //int alsa=0; |
412 //#endif | |
413 | |
414 // streaming: | |
417 int audio_id=-1; | 415 int audio_id=-1; |
418 int video_id=-1; | 416 int video_id=-1; |
419 int dvdsub_id=-1; | 417 int dvdsub_id=-1; |
418 int vcd_track=0; | |
419 char *stream_dump_name=NULL; | |
420 int stream_dump_type=0; | |
421 int index_mode=-1; // -1=untouched 0=don't use index 1=use (geneate) index | |
422 int force_ni=0; | |
423 | |
420 float default_max_pts_correction=-1;//0.01f; | 424 float default_max_pts_correction=-1;//0.01f; |
421 int delay_corrected=1; | |
422 float force_fps=0; | |
423 int force_srate=0; | |
424 float audio_delay=0; | |
425 float initial_pts_delay=0; | |
426 int vcd_track=0; | |
427 #ifdef VCD_CACHE | |
428 int vcd_cache_size=128; | |
429 #endif | |
430 int index_mode=-1; // -1=untouched 0=don't use index 1=use (geneate) index | |
431 #ifdef AVI_SYNC_BPS | 425 #ifdef AVI_SYNC_BPS |
432 int pts_from_bps=1; | 426 int pts_from_bps=1; |
433 #else | 427 #else |
434 int pts_from_bps=0; | 428 int pts_from_bps=0; |
435 #endif | 429 #endif |
430 | |
431 float force_fps=0; | |
432 int force_srate=0; | |
433 float audio_delay=0; | |
436 int frame_dropping=0; // option 0=no drop 1= drop vo 2= drop decode | 434 int frame_dropping=0; // option 0=no drop 1= drop vo 2= drop decode |
437 char* title="MPlayer"; | 435 |
438 // screen info: | 436 // screen info: |
439 char* video_driver=NULL; //"mga"; // default | 437 char* video_driver=NULL; //"mga"; // default |
440 char* audio_driver=NULL; | 438 char* audio_driver=NULL; |
441 int fullscreen=0; | 439 int fullscreen=0; |
442 int vidmode=0; | 440 int vidmode=0; |
443 int softzoom=0; | 441 int softzoom=0; |
444 int flip=-1; | 442 int flip=-1; |
445 int screen_size_x=0;//SCREEN_SIZE_X; | 443 int screen_size_x=0;//SCREEN_SIZE_X; |
446 int screen_size_y=0;//SCREEN_SIZE_Y; | 444 int screen_size_y=0;//SCREEN_SIZE_Y; |
447 int screen_size_xy=0; | 445 int screen_size_xy=0; |
448 // movie info: | 446 |
449 int out_fmt=0; | 447 // sub: |
450 char *dsp=NULL; | |
451 int force_ni=0; | |
452 char *conffile; | |
453 int conffile_fd; | |
454 char *font_name=NULL; | 448 char *font_name=NULL; |
455 float font_factor=0.75; | 449 float font_factor=0.75; |
456 char *sub_name=NULL; | 450 char *sub_name=NULL; |
457 float sub_delay=0; | 451 float sub_delay=0; |
458 float sub_fps=0; | 452 float sub_fps=0; |
459 int sub_auto = 1; | 453 int sub_auto = 1; |
460 char *stream_dump_name=NULL; | 454 |
461 int stream_dump_type=0; | 455 char *dsp=NULL; |
462 //int user_bpp=0; | |
463 | |
464 int osd_visible=100; | |
465 int osd_function=OSD_PLAY; | |
466 int osd_last_pts=-303; | |
467 | |
468 float a_frame=0; // Audio | |
469 | |
470 float rel_seek_secs=0; | |
471 | 456 |
472 #include "mixer.h" | 457 #include "mixer.h" |
473 #include "cfg-mplayer.h" | 458 #include "cfg-mplayer.h" |
474 | 459 |
475 void parse_cfgfiles( void ) | 460 void parse_cfgfiles( void ) |
476 { | 461 { |
462 char *conffile; | |
463 int conffile_fd; | |
477 if (parse_config_file(conf, "/etc/mplayer.conf") < 0) | 464 if (parse_config_file(conf, "/etc/mplayer.conf") < 0) |
478 exit(1); | 465 exit(1); |
479 if ((conffile = get_path("")) == NULL) { | 466 if ((conffile = get_path("")) == NULL) { |
480 printf("Can't find HOME dir\n"); | 467 printf("Can't find HOME dir\n"); |
481 } else { | 468 } else { |
499 #ifndef HAVE_GUI | 486 #ifndef HAVE_GUI |
500 int main(int argc,char* argv[], char *envp[]){ | 487 int main(int argc,char* argv[], char *envp[]){ |
501 #else | 488 #else |
502 int mplayer(int argc,char* argv[], char *envp[]){ | 489 int mplayer(int argc,char* argv[], char *envp[]){ |
503 #endif | 490 #endif |
491 | |
492 char* filename=NULL; //"MI2-Trailer.avi"; | |
493 stream_t* stream=NULL; | |
494 int file_format=DEMUXER_TYPE_UNKNOWN; | |
495 // | |
496 int delay_corrected=1; | |
497 float initial_pts_delay=0; | |
498 #ifdef VCD_CACHE | |
499 int vcd_cache_size=128; | |
500 #endif | |
501 char* title="MPlayer"; | |
502 | |
503 // movie info: | |
504 int out_fmt=0; | |
505 //int user_bpp=0; | |
506 | |
507 int osd_visible=100; | |
508 int osd_function=OSD_PLAY; | |
509 int osd_last_pts=-303; | |
510 | |
511 float a_frame=0; // Audio | |
512 | |
513 float rel_seek_secs=0; | |
514 | |
515 int i; | |
516 int f; // filedes | |
504 | 517 |
505 printf("%s",banner_text); | 518 printf("%s",banner_text); |
506 | 519 |
507 #ifdef HAVE_GUI | 520 #ifdef HAVE_GUI |
508 if ( nogui ) | 521 if ( nogui ) |
1469 printf("Audio: no sound\n"); | 1482 printf("Audio: no sound\n"); |
1470 if(verbose) printf("Freeing %d unused audio chunks\n",d_audio->packs); | 1483 if(verbose) printf("Freeing %d unused audio chunks\n",d_audio->packs); |
1471 ds_free_packs(d_audio); // free buffered chunks | 1484 ds_free_packs(d_audio); // free buffered chunks |
1472 d_audio->id=-2; // do not read audio chunks | 1485 d_audio->id=-2; // do not read audio chunks |
1473 if(sh_audio) if(sh_audio->a_buffer) free(sh_audio->a_buffer); | 1486 if(sh_audio) if(sh_audio->a_buffer) free(sh_audio->a_buffer); |
1474 alsa=1; | 1487 //alsa=1; |
1475 // fake, required for timer: | 1488 // fake, required for timer: |
1476 #if 1 | 1489 #if 1 |
1477 sh_audio=NULL; | 1490 sh_audio=NULL; |
1478 #else | 1491 #else |
1479 sh_audio=new_sh_audio(255); // FIXME!!!!!!!!!! | 1492 sh_audio=new_sh_audio(255); // FIXME!!!!!!!!!! |
2124 d_video->pack_no=0; | 2137 d_video->pack_no=0; |
2125 for(i=0;i<video_chunk_pos;i++){ | 2138 for(i=0;i<video_chunk_pos;i++){ |
2126 int id=((AVIINDEXENTRY *)demuxer->idx)[i].ckid; | 2139 int id=((AVIINDEXENTRY *)demuxer->idx)[i].ckid; |
2127 if(avi_stream_id(id)==d_video->id) ++d_video->pack_no; | 2140 if(avi_stream_id(id)==d_video->id) ++d_video->pack_no; |
2128 } | 2141 } |
2142 num_frames=d_video->pack_no; | |
2129 avi_video_pts=d_video->pack_no*(float)sh_video->video.dwScale/(float)sh_video->video.dwRate; | 2143 avi_video_pts=d_video->pack_no*(float)sh_video->video.dwScale/(float)sh_video->video.dwRate; |
2130 | 2144 |
2131 if(has_audio){ | 2145 if(has_audio){ |
2132 int i; | 2146 int i; |
2133 int apos=0; | 2147 int apos=0; |