comparison mplayer.c @ 956:a6cecd9a1bad

'-ao' switch (including '-ao help'), fixing Arpi's bug (short name 'null' for both of oss and null driver ;)
author lgb
date Sun, 03 Jun 2001 00:24:49 +0000
parents 3a3304cd9fd5
children 162a78d3cc08
comparison
equal deleted inserted replaced
955:3a3304cd9fd5 956:a6cecd9a1bad
432 #endif 432 #endif
433 int frame_dropping=0; // option 0=no drop 1= drop vo 2= drop decode 433 int frame_dropping=0; // option 0=no drop 1= drop vo 2= drop decode
434 char* title="MPlayer"; 434 char* title="MPlayer";
435 // screen info: 435 // screen info:
436 char* video_driver=NULL; //"mga"; // default 436 char* video_driver=NULL; //"mga"; // default
437 char* audio_driver=NULL;
437 int fullscreen=0; 438 int fullscreen=0;
438 int vidmode=0; 439 int vidmode=0;
439 int softzoom=0; 440 int softzoom=0;
440 int flip=-1; 441 int flip=-1;
441 int screen_size_x=0;//SCREEN_SIZE_X; 442 int screen_size_x=0;//SCREEN_SIZE_X;
519 const vo_info_t *info = video_out_drivers[i++]->get_info (); 520 const vo_info_t *info = video_out_drivers[i++]->get_info ();
520 printf("\t%s\t%s\n", info->short_name, info->name); 521 printf("\t%s\t%s\n", info->short_name, info->name);
521 } 522 }
522 printf("\n"); 523 printf("\n");
523 exit(0); 524 exit(0);
524 } 525 }
526 if(audio_driver && strcmp(audio_driver,"help")==0){
527 printf("Available audio output drivers:\n");
528 i=0;
529 while (audio_out_drivers[i]) {
530 const ao_info_t *info = audio_out_drivers[i++]->info;
531 printf("\t%s\t%s\n", info->short_name, info->name);
532 }
533 printf("\n");
534 exit(0);
535 }
525 #ifdef HAVE_GUI 536 #ifdef HAVE_GUI
526 } 537 }
527 #endif 538 #endif
528 539
529 if(!filename){ 540 if(!filename){
542 if(strcmp(info->short_name,video_driver) == 0){ 553 if(strcmp(info->short_name,video_driver) == 0){
543 video_out = video_out_drivers[i];break; 554 video_out = video_out_drivers[i];break;
544 } 555 }
545 } 556 }
546 if(!video_out){ 557 if(!video_out){
547 printf("Invalid video output driver name: %s\n",video_driver); 558 printf("Invalid video output driver name: %s\nUse '-vo help' to get a list of available video drivers.\n",video_driver);
548 return 0; 559 return 0;
549 } 560 }
561
562 // check audio_out driver name:
563 if(!audio_driver)
564 audio_out=audio_out_drivers[0];
565 else
566 for (i=0; audio_out_drivers[i] != NULL; i++){
567 const ao_info_t *info = audio_out_drivers[i]->info;
568 if(strcmp(info->short_name,audio_driver) == 0){
569 audio_out = audio_out_drivers[i];break;
570 }
571 }
572 if (!audio_out){
573 printf("Invalid audio output driver name: %s\nUse '-ao help' to get a list of available audio drivers.\n",audio_driver);
574 return 0;
575 }
550 576
551 // check audio_out 577 // check audio_out
552 audio_out=audio_out_drivers[0]; 578 //audio_out=audio_out_drivers[0];
553 579
554 // check codec.conf 580 // check codec.conf
555 if(!parse_codec_cfg(get_path("codecs.conf"))){ 581 if(!parse_codec_cfg(get_path("codecs.conf"))){
556 printf("(copy/link DOCS/codecs.conf to ~/.mplayer/codecs.conf)\n"); 582 printf("(copy/link DOCS/codecs.conf to ~/.mplayer/codecs.conf)\n");
557 GUI_MSG( mplCodecConfNotFound ) 583 GUI_MSG( mplCodecConfNotFound )