comparison mencoder.c @ 7180:28677d779205

-afm/-vfm migration from ID (int) to NAME (string) - simplifies code and makes dlopen()'ing possible
author arpi
date Fri, 30 Aug 2002 21:44:20 +0000
parents 3854945aefbb
children 22beff6edf75
comparison
equal deleted inserted replaced
7179:a258b9b7669e 7180:28677d779205
85 static char* spudec_ifo=NULL; 85 static char* spudec_ifo=NULL;
86 86
87 static int has_audio=1; 87 static int has_audio=1;
88 char *audio_codec=NULL; // override audio codec 88 char *audio_codec=NULL; // override audio codec
89 char *video_codec=NULL; // override video codec 89 char *video_codec=NULL; // override video codec
90 int audio_family=-1; // override audio codec family 90 char* audio_fm=NULL; // override audio codec family
91 int video_family=-1; // override video codec family 91 char* video_fm=NULL; // override video codec family
92 92
93 // libvo opts: (defiend at libmpcodecs/vd.c) 93 // libvo opts: (defiend at libmpcodecs/vd.c)
94 extern int screen_size_xy; 94 extern int screen_size_xy;
95 extern float movie_aspect; 95 extern float movie_aspect;
96 extern int softzoom; 96 extern int softzoom;
486 } 486 }
487 487
488 if(sh_audio && (out_audio_codec || seek_to_sec || !sh_audio->wf)){ 488 if(sh_audio && (out_audio_codec || seek_to_sec || !sh_audio->wf)){
489 // Go through the codec.conf and find the best codec... 489 // Go through the codec.conf and find the best codec...
490 sh_audio->codec=NULL; 490 sh_audio->codec=NULL;
491 if(audio_family!=-1) mp_msg(MSGT_MENCODER,MSGL_INFO,MSGTR_TryForceAudioFmt,audio_family); 491 if(audio_fm) mp_msg(MSGT_MENCODER,MSGL_INFO,MSGTR_TryForceAudioFmtStr,audio_fm);
492 while(1){ 492 while(1){
493 sh_audio->codec=find_codec(sh_audio->format,NULL,sh_audio->codec,1); 493 sh_audio->codec=find_codec(sh_audio->format,NULL,sh_audio->codec,1);
494 if(!sh_audio->codec){ 494 if(!sh_audio->codec){
495 if(audio_family!=-1) { 495 if(audio_fm) {
496 sh_audio->codec=NULL; /* re-search */ 496 sh_audio->codec=NULL; /* re-search */
497 mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantFindAfmtFallback); 497 mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantFindAfmtFallback);
498 audio_family=-1; 498 audio_fm=NULL;
499 continue; 499 continue;
500 } 500 }
501 mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantFindAudioCodec,sh_audio->format); 501 mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantFindAudioCodec,sh_audio->format);
502 mp_msg(MSGT_MENCODER,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf")); 502 mp_msg(MSGT_MENCODER,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf"));
503 sh_audio=d_audio->sh=NULL; 503 sh_audio=d_audio->sh=NULL;
504 break; 504 break;
505 } 505 }
506 if(audio_codec && strcmp(sh_audio->codec->name,audio_codec)) continue; 506 if(audio_codec && strcmp(sh_audio->codec->name,audio_codec)) continue;
507 else if(audio_family!=-1 && sh_audio->codec->driver!=audio_family) continue; 507 else if(audio_fm && strcmp(sh_audio->codec->drv,audio_fm)) continue;
508 mp_msg(MSGT_MENCODER,MSGL_INFO,"%s audio codec: [%s] drv:%d (%s)\n",audio_codec?"Forcing":"Detected",sh_audio->codec->name,sh_audio->codec->driver,sh_audio->codec->info); 508 mp_msg(MSGT_MENCODER,MSGL_INFO,"%s audio codec: [%s] afm:%s (%s)\n",audio_codec?"Forcing":"Detected",sh_audio->codec->name,sh_audio->codec->drv,sh_audio->codec->info);
509 break; 509 break;
510 } 510 }
511 } 511 }
512 512
513 if(sh_audio && (out_audio_codec || seek_to_sec || !sh_audio->wf)){ 513 if(sh_audio && (out_audio_codec || seek_to_sec || !sh_audio->wf)){
668 mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_ForcedVideoCodec,video_codec); 668 mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_ForcedVideoCodec,video_codec);
669 init_video(sh_video,video_codec,-1,-1); 669 init_video(sh_video,video_codec,-1,-1);
670 } else { 670 } else {
671 int status; 671 int status;
672 // try in stability order: UNTESTED, WORKING, BUGGY, BROKEN 672 // try in stability order: UNTESTED, WORKING, BUGGY, BROKEN
673 if(video_family>=0) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_TryForceVideoFmt,video_family); 673 if(video_fm) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_TryForceVideoFmtStr,video_fm);
674 for(status=CODECS_STATUS__MAX;status>=CODECS_STATUS__MIN;--status){ 674 for(status=CODECS_STATUS__MAX;status>=CODECS_STATUS__MIN;--status){
675 if(video_family>=0) // try first the preferred codec family: 675 if(video_fm) // try first the preferred codec family:
676 if(init_video(sh_video,NULL,video_family,status)) break; 676 if(init_video(sh_video,NULL,video_fm,status)) break;
677 if(init_video(sh_video,NULL,-1,status)) break; 677 if(init_video(sh_video,NULL,NULL,status)) break;
678 } 678 }
679 } 679 }
680 if(!sh_video->inited){ 680 if(!sh_video->inited){
681 mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantFindVideoCodec,sh_video->format); 681 mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantFindVideoCodec,sh_video->format);
682 mp_msg(MSGT_CPLAYER,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf")); 682 mp_msg(MSGT_CPLAYER,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf"));
683 mencoder_exit(1,NULL); 683 mencoder_exit(1,NULL);
684 } 684 }
685 mp_msg(MSGT_CPLAYER,MSGL_INFO,"%s video codec: [%s] drv:%d (%s)\n", 685 mp_msg(MSGT_CPLAYER,MSGL_INFO,"%s video codec: [%s] vfm:%s (%s)\n",
686 video_codec?mp_gettext("Forcing"):mp_gettext("Detected"),sh_video->codec->name,sh_video->codec->driver,sh_video->codec->info); 686 video_codec?mp_gettext("Forcing"):mp_gettext("Detected"),sh_video->codec->name,sh_video->codec->drv,sh_video->codec->info);
687 mp_msg(MSGT_CPLAYER,MSGL_INFO,"==========================================================================\n"); 687 mp_msg(MSGT_CPLAYER,MSGL_INFO,"==========================================================================\n");
688 688
689 } 689 }
690 690
691 /* force output fourcc to .. */ 691 /* force output fourcc to .. */