summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cfg-mplayer.h2
-rw-r--r--mplayer.c31
2 files changed, 25 insertions, 8 deletions
diff --git a/cfg-mplayer.h b/cfg-mplayer.h
index 896467d561..ad40e9b806 100644
--- a/cfg-mplayer.h
+++ b/cfg-mplayer.h
@@ -75,6 +75,8 @@ struct config conf[]={
{"mc", &default_max_pts_correction, CONF_TYPE_FLOAT, CONF_RANGE, 0, 10},
{"fps", &force_fps, CONF_TYPE_FLOAT, CONF_MIN, 0, 0},
{"afm", &audio_format, CONF_TYPE_INT, CONF_RANGE, 1, 6},
+ {"dshow", &allow_dshow, CONF_TYPE_FLAG, 0, 0, 1},
+ {"nodshow", &allow_dshow, CONF_TYPE_FLAG, 0, 1, 0},
{"vcd", &vcd_track, CONF_TYPE_INT, CONF_RANGE, 1, 99},
{"divxq", "Option -divxq has been renamed to -pp (postprocessing), use -pp !\n",
CONF_TYPE_PRINT, 0, 0, 0},
diff --git a/mplayer.c b/mplayer.c
index fe9429f2df..044e3c593d 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -380,6 +380,11 @@ int has_audio=1;
//int has_video=1;
//
int audio_format=0; // override
+#ifdef USE_DIRECTSHOW
+int allow_dshow=1;
+#else
+int allow_dshow=0;
+#endif
#ifdef ALSA_TIMER
int alsa=1;
#else
@@ -890,13 +895,18 @@ if(stream_dump_type){
//================== Init AUDIO (codec) ==========================
if(has_audio){
// Go through the codec.conf and find the best codec...
- sh_audio->codec=find_codec(sh_audio->format,NULL,NULL,1);
- if(!sh_audio->codec){
- printf("Can't find codec for audio format 0x%X !\n",sh_audio->format);
- has_audio=0;
- } else {
+ sh_audio->codec=NULL;
+ while(1){
+ sh_audio->codec=find_codec(sh_audio->format,NULL,sh_audio->codec,1);
+ if(!sh_audio->codec){
+ printf("Can't find codec for audio format 0x%X !\n",sh_audio->format);
+ has_audio=0;
+ break;
+ }
+ if(audio_format>0 && sh_audio->codec->driver!=audio_format) continue;
printf("Found audio codec: [%s] drv:%d (%s)\n",sh_audio->codec->name,sh_audio->codec->driver,sh_audio->codec->info);
//has_audio=sh_audio->codec->driver;
+ break;
}
}
@@ -913,11 +923,16 @@ if(has_audio){
//================== Init VIDEO (codec & libvo) ==========================
// Go through the codec.conf and find the best codec...
-sh_video->codec=find_codec(sh_video->format,
- sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL,NULL,0);
-if(!sh_video->codec){
+sh_video->codec=NULL;
+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){
printf("Can't find codec for video format 0x%X !\n",sh_video->format);
exit(1);
+ }
+ if(!allow_dshow && sh_video->codec->driver==4) continue; // skip DShow
+ break;
}
//has_video=sh_video->codec->driver;