# HG changeset patch # User atmos4 # Date 994632356 0 # Node ID fa50e6bc6091841c65b4a58bf439aa729bbb5eb7 # Parent ea586e73d3b3099445c125e1b495d7dcbb0b2168 As promised, -afm and -vfm to prefer audio/video driver family, -ac and -vc have higher precedence, so they can override -afm/-vfm. diff -r ea586e73d3b3 -r fa50e6bc6091 cfg-mplayer.h --- a/cfg-mplayer.h Sun Jul 08 19:54:43 2001 +0000 +++ b/cfg-mplayer.h Sun Jul 08 22:45:56 2001 +0000 @@ -134,7 +134,8 @@ {"mc", &default_max_pts_correction, CONF_TYPE_FLOAT, CONF_RANGE, 0, 10}, {"fps", &force_fps, CONF_TYPE_FLOAT, CONF_MIN, 0, 0}, {"srate", &force_srate, CONF_TYPE_INT, CONF_RANGE, 1000, 8*48000+1}, - {"afm", &audio_format, CONF_TYPE_INT, CONF_RANGE, 1, 6}, // This might be removed later - atmos :: + {"afm", &audio_family, CONF_TYPE_INT, CONF_RANGE, 0, 9}, // keep ranges in sync + {"vfm", &video_family, CONF_TYPE_INT, CONF_RANGE, 0, 6}, // with codec-cfg.c {"ac", &audio_codec, CONF_TYPE_STRING, 0, 0, 0}, {"vc", &video_codec, CONF_TYPE_STRING, 0, 0, 0}, {"dshow", &allow_dshow, CONF_TYPE_FLAG, 0, 0, 1}, // Is this still needed? atmos :: diff -r ea586e73d3b3 -r fa50e6bc6091 mplayer.c --- a/mplayer.c Sun Jul 08 19:54:43 2001 +0000 +++ b/mplayer.c Sun Jul 08 22:45:56 2001 +0000 @@ -256,8 +256,11 @@ //int has_video=1; char *audio_codec=NULL; // override audio codec char *video_codec=NULL; // override video codec -int audio_format=0; // override - This might be removed - atmos :: +int audio_family=-1; // override audio codec family +int video_family=-1; // override video codec family +// IMHO this stuff is no longer of use, or is there a special +// reason why dshow should be completely disabled? - atmos :: #ifdef USE_DIRECTSHOW int allow_dshow=1; #else @@ -727,7 +730,7 @@ stream_seek(demuxer->stream,seek_to_byte); // Arpi? why is this extra and not in codec selection? - atmos :: // Hmm. This should be fixed somehow... I'll check diz later. - arpi - if(audio_format) demuxer->audio->type=audio_format; // override audio format + if(audio_family!=-1) demuxer->audio->type=audio_family; // override audio format if(ds_fill_buffer(demuxer->video)){ printf("Detected MPEG-PS file format!\n"); file_format=DEMUXER_TYPE_MPEG_PS; @@ -1079,9 +1082,16 @@ if(has_audio){ // Go through the codec.conf and find the best codec... sh_audio->codec=NULL; + if(audio_family!=-1) printf("Trying to force audio codec driver family %d ...\n",video_family); while(1){ sh_audio->codec=find_codec(sh_audio->format,NULL,sh_audio->codec,1); if(!sh_audio->codec){ + if(audio_family!=-1) { + sh_audio->codec=NULL; /* re-search */ + printf("Can't find audio codec for forced driver family, fallback to other drivers.\n"); + audio_family=-1; + continue; + } printf("Can't find codec for audio format 0x%X !\n",sh_audio->format); printf("*** Try to upgrade %s from DOCS/codecs.conf\n",get_path("codecs.conf")); printf("*** If it's still not OK, then read DOCS/CODECS!\n"); @@ -1089,6 +1099,7 @@ break; } if(audio_codec && strcmp(sh_audio->codec->name,audio_codec)) continue; + else if(audio_family!=-1 && sh_audio->codec->driver!=audio_family) continue; printf("%s audio codec: [%s] drv:%d (%s)\n",audio_codec?"Forcing":"Detected",sh_audio->codec->name,sh_audio->codec->driver,sh_audio->codec->info); //has_audio=sh_audio->codec->driver; break; @@ -1110,10 +1121,17 @@ // Go through the codec.conf and find the best codec... sh_video->codec=NULL; +if(video_family!=-1) printf("Trying to force video codec driver family %d ...\n",video_family); while(1){ sh_video->codec=find_codec(sh_video->format, sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL,sh_video->codec,0); if(!sh_video->codec){ + if(video_family!=-1) { + sh_video->codec=NULL; /* re-search */ + printf("Can't find video codec for forced driver family, fallback to other drivers.\n"); + video_family=-1; + continue; + } printf("Can't find codec for video format 0x%X !\n",sh_video->format); printf("*** Try to upgrade %s from DOCS/codecs.conf\n",get_path("codecs.conf")); printf("*** If it's still not OK, then read DOCS/CODECS!\n"); @@ -1130,6 +1148,7 @@ // is next line needed anymore? - atmos :: if(!allow_dshow && sh_video->codec->driver==4) continue; // skip DShow else if(video_codec && strcmp(sh_video->codec->name,video_codec)) continue; + else if(video_family!=-1 && sh_video->codec->driver!=video_family) continue; break; } //has_video=sh_video->codec->driver;