comparison mplayer.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 b212f74e14ec
children 1eadce15446c
comparison
equal deleted inserted replaced
7179:a258b9b7669e 7180:28677d779205
174 // codecs: 174 // codecs:
175 int has_audio=1; 175 int has_audio=1;
176 int has_video=1; 176 int has_video=1;
177 char *audio_codec=NULL; // override audio codec 177 char *audio_codec=NULL; // override audio codec
178 char *video_codec=NULL; // override video codec 178 char *video_codec=NULL; // override video codec
179 int audio_family=-1; // override audio codec family 179 char *audio_fm=NULL; // override audio codec family
180 int video_family=-1; // override video codec family 180 char *video_fm=NULL; // override video codec family
181 181
182 // IMHO this stuff is no longer of use, or is there a special 182 // IMHO this stuff is no longer of use, or is there a special
183 // reason why dshow should be completely disabled? - atmos :: 183 // reason why dshow should be completely disabled? - atmos ::
184 // yes, people without working c++ compiler can disable it - A'rpi 184 // yes, people without working c++ compiler can disable it - A'rpi
185 #ifdef USE_DIRECTSHOW 185 #ifdef USE_DIRECTSHOW
1199 current_module="find_audio_codec"; 1199 current_module="find_audio_codec";
1200 1200
1201 if(sh_audio){ 1201 if(sh_audio){
1202 // Go through the codec.conf and find the best codec... 1202 // Go through the codec.conf and find the best codec...
1203 sh_audio->codec=NULL; 1203 sh_audio->codec=NULL;
1204 if(audio_family!=-1) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_TryForceAudioFmt,audio_family); 1204 if(audio_fm) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_TryForceAudioFmtStr,audio_fm);
1205 while(1){ 1205 while(1){
1206 sh_audio->codec=find_codec(sh_audio->format,NULL,sh_audio->codec,1); 1206 sh_audio->codec=find_codec(sh_audio->format,NULL,sh_audio->codec,1);
1207 if(!sh_audio->codec){ 1207 if(!sh_audio->codec){
1208 if(audio_family!=-1) { 1208 if(audio_fm) {
1209 sh_audio->codec=NULL; /* re-search */ 1209 sh_audio->codec=NULL; /* re-search */
1210 mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantFindAfmtFallback); 1210 mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantFindAfmtFallback);
1211 audio_family=-1; 1211 audio_fm=NULL;
1212 continue; 1212 continue;
1213 } 1213 }
1214 mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantFindAudioCodec,sh_audio->format); 1214 mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantFindAudioCodec,sh_audio->format);
1215 mp_msg(MSGT_CPLAYER,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf")); 1215 mp_msg(MSGT_CPLAYER,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf"));
1216 sh_audio=d_audio->sh=NULL; 1216 sh_audio=d_audio->sh=NULL;
1217 break; 1217 break;
1218 } 1218 }
1219 if(audio_codec && strcmp(sh_audio->codec->name,audio_codec)) continue; 1219 if(audio_codec && strcmp(sh_audio->codec->name,audio_codec)) continue;
1220 else if(audio_family!=-1 && sh_audio->codec->driver!=audio_family) continue; 1220 else if(audio_fm && strcmp(sh_audio->codec->drv,audio_fm)) continue;
1221 mp_msg(MSGT_CPLAYER,MSGL_INFO,"%s audio codec: [%s] afm:%d (%s)\n", 1221 mp_msg(MSGT_CPLAYER,MSGL_INFO,"%s audio codec: [%s] afm:%s (%s)\n",
1222 audio_codec?mp_gettext("Forcing"):mp_gettext("Detected"),sh_audio->codec->name,sh_audio->codec->driver,sh_audio->codec->info); 1222 audio_codec?mp_gettext("Forcing"):mp_gettext("Detected"),sh_audio->codec->name,sh_audio->codec->drv,sh_audio->codec->info);
1223 break; 1223 break;
1224 } 1224 }
1225 } 1225 }
1226 1226
1227 current_module="init_audio_codec"; 1227 current_module="init_audio_codec";
1273 mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_ForcedVideoCodec,video_codec); 1273 mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_ForcedVideoCodec,video_codec);
1274 init_video(sh_video,video_codec,-1,-1); 1274 init_video(sh_video,video_codec,-1,-1);
1275 } else { 1275 } else {
1276 int status; 1276 int status;
1277 // try in stability order: UNTESTED, WORKING, BUGGY, BROKEN 1277 // try in stability order: UNTESTED, WORKING, BUGGY, BROKEN
1278 if(video_family>=0) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_TryForceVideoFmt,video_family); 1278 if(video_fm) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_TryForceVideoFmtStr,video_fm);
1279 for(status=CODECS_STATUS__MAX;status>=CODECS_STATUS__MIN;--status){ 1279 for(status=CODECS_STATUS__MAX;status>=CODECS_STATUS__MIN;--status){
1280 if(video_family>=0) // try first the preferred codec family: 1280 if(video_fm) // try first the preferred codec family:
1281 if(init_video(sh_video,NULL,video_family,status)) break; 1281 if(init_video(sh_video,NULL,video_fm,status)) break;
1282 if(init_video(sh_video,NULL,-1,status)) break; 1282 if(init_video(sh_video,NULL,NULL,status)) break;
1283 } 1283 }
1284 } 1284 }
1285 if(!sh_video->inited){ 1285 if(!sh_video->inited){
1286 mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantFindVideoCodec,sh_video->format); 1286 mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantFindVideoCodec,sh_video->format);
1287 mp_msg(MSGT_CPLAYER,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf")); 1287 mp_msg(MSGT_CPLAYER,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf"));
1289 if(!sh_audio) goto goto_next_file; 1289 if(!sh_audio) goto goto_next_file;
1290 sh_video = d_video->sh = NULL; 1290 sh_video = d_video->sh = NULL;
1291 goto main; // exit_player(MSGTR_Exit_error); 1291 goto main; // exit_player(MSGTR_Exit_error);
1292 } 1292 }
1293 1293
1294 mp_msg(MSGT_CPLAYER,MSGL_INFO,"%s video codec: [%s] vfm:%d (%s)\n", 1294 mp_msg(MSGT_CPLAYER,MSGL_INFO,"%s video codec: [%s] vfm:%s (%s)\n",
1295 video_codec?mp_gettext("Forcing"):mp_gettext("Detected"),sh_video->codec->name,sh_video->codec->driver,sh_video->codec->info); 1295 video_codec?mp_gettext("Forcing"):mp_gettext("Detected"),sh_video->codec->name,sh_video->codec->drv,sh_video->codec->info);
1296 mp_msg(MSGT_CPLAYER,MSGL_INFO,"==========================================================================\n"); 1296 mp_msg(MSGT_CPLAYER,MSGL_INFO,"==========================================================================\n");
1297 1297
1298 if(auto_quality>0){ 1298 if(auto_quality>0){
1299 // Auto quality option enabled 1299 // Auto quality option enabled
1300 output_quality=get_video_quality_max(sh_video); 1300 output_quality=get_video_quality_max(sh_video);