mirror of
https://github.com/mpv-player/mpv
synced 2025-01-12 01:49:33 +00:00
-vcodec option (maybe some other name would be better though) to select between driver types without editing codecs.conf. mplayer will default to normal codec search loop if it does not find codec for the specified driver type. config range checking for the parameter (an integer) should be cleaned, IMHO
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1286 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
b5933be0d7
commit
52430859d4
@ -40,6 +40,8 @@ extern int ao_pcm_waveheader;
|
|||||||
extern char *mDisplayName;
|
extern char *mDisplayName;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern int force_vcodec;
|
||||||
|
|
||||||
struct config conf[]={
|
struct config conf[]={
|
||||||
/* name, pointer, type, flags, min, max */
|
/* name, pointer, type, flags, min, max */
|
||||||
{"include", cfg_include, CONF_TYPE_FUNC_PARAM, 0, 0, 0}, /* this must be the first!!! */
|
{"include", cfg_include, CONF_TYPE_FUNC_PARAM, 0, 0, 0}, /* this must be the first!!! */
|
||||||
@ -55,6 +57,7 @@ struct config conf[]={
|
|||||||
{"display", &mDisplayName, CONF_TYPE_STRING, 0, 0, 0},
|
{"display", &mDisplayName, CONF_TYPE_STRING, 0, 0, 0},
|
||||||
#endif
|
#endif
|
||||||
{"osdlevel", &osd_level, CONF_TYPE_INT, CONF_RANGE, 0, 2 },
|
{"osdlevel", &osd_level, CONF_TYPE_INT, CONF_RANGE, 0, 2 },
|
||||||
|
{"vcodec", &force_vcodec, CONF_TYPE_INT, CONF_RANGE, 1, 5 },
|
||||||
#ifdef HAVE_LIBCSS
|
#ifdef HAVE_LIBCSS
|
||||||
{"dvdauth", &dvd_auth_device, CONF_TYPE_STRING, 0, 0, 0},
|
{"dvdauth", &dvd_auth_device, CONF_TYPE_STRING, 0, 0, 0},
|
||||||
{"dvdkey", &dvdimportkey, CONF_TYPE_STRING, 0, 0, 0},
|
{"dvdkey", &dvdimportkey, CONF_TYPE_STRING, 0, 0, 0},
|
||||||
|
11
mplayer.c
11
mplayer.c
@ -317,6 +317,8 @@ int has_audio=1;
|
|||||||
//int has_video=1;
|
//int has_video=1;
|
||||||
int audio_format=0; // override
|
int audio_format=0; // override
|
||||||
|
|
||||||
|
int force_vcodec=-1;
|
||||||
|
|
||||||
#ifdef USE_DIRECTSHOW
|
#ifdef USE_DIRECTSHOW
|
||||||
int allow_dshow=1;
|
int allow_dshow=1;
|
||||||
#else
|
#else
|
||||||
@ -1164,10 +1166,17 @@ if(has_audio){
|
|||||||
|
|
||||||
// Go through the codec.conf and find the best codec...
|
// Go through the codec.conf and find the best codec...
|
||||||
sh_video->codec=NULL;
|
sh_video->codec=NULL;
|
||||||
|
if (force_vcodec!=-1) printf("Trying to use forced video codec driver %d ...\n",force_vcodec);
|
||||||
while(1){
|
while(1){
|
||||||
sh_video->codec=find_codec(sh_video->format,
|
sh_video->codec=find_codec(sh_video->format,
|
||||||
sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL,sh_video->codec,0);
|
sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL,sh_video->codec,0);
|
||||||
if(!sh_video->codec){
|
if(!sh_video->codec){
|
||||||
|
if(force_vcodec!=-1) {
|
||||||
|
sh_video->codec=NULL; /* re-search */
|
||||||
|
printf("Can't find video codec for forced driver %d, defaulting to other drivers.\n",force_vcodec);
|
||||||
|
force_vcodec=-1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
printf("Can't find codec for video format 0x%X !\n",sh_video->format);
|
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("*** 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");
|
printf("*** If it's still not OK, then read DOCS/CODECS!\n");
|
||||||
@ -1181,6 +1190,8 @@ while(1){
|
|||||||
#endif
|
#endif
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
if(sh_video->codec->driver==force_vcodec) break; /* OK, we find our codec */
|
||||||
|
if(force_vcodec!=-1&&sh_video->codec->driver!=force_vcodec) continue;
|
||||||
if(!allow_dshow && sh_video->codec->driver==4) continue; // skip DShow
|
if(!allow_dshow && sh_video->codec->driver==4) continue; // skip DShow
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user