comparison mplayer.c @ 1285:202d9e2dc202

-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
author lgb
date Fri, 06 Jul 2001 21:17:22 +0000
parents 94f2853ec6f4
children 543a94b241a2
comparison
equal deleted inserted replaced
1284:c11ca3d1a6e9 1285:202d9e2dc202
314 char *seek_to_sec=NULL; 314 char *seek_to_sec=NULL;
315 int seek_to_byte=0; 315 int seek_to_byte=0;
316 int has_audio=1; 316 int has_audio=1;
317 //int has_video=1; 317 //int has_video=1;
318 int audio_format=0; // override 318 int audio_format=0; // override
319
320 int force_vcodec=-1;
319 321
320 #ifdef USE_DIRECTSHOW 322 #ifdef USE_DIRECTSHOW
321 int allow_dshow=1; 323 int allow_dshow=1;
322 #else 324 #else
323 int allow_dshow=0; 325 int allow_dshow=0;
1162 1164
1163 //================== Init VIDEO (codec & libvo) ========================== 1165 //================== Init VIDEO (codec & libvo) ==========================
1164 1166
1165 // Go through the codec.conf and find the best codec... 1167 // Go through the codec.conf and find the best codec...
1166 sh_video->codec=NULL; 1168 sh_video->codec=NULL;
1169 if (force_vcodec!=-1) printf("Trying to use forced video codec driver %d ...\n",force_vcodec);
1167 while(1){ 1170 while(1){
1168 sh_video->codec=find_codec(sh_video->format, 1171 sh_video->codec=find_codec(sh_video->format,
1169 sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL,sh_video->codec,0); 1172 sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL,sh_video->codec,0);
1170 if(!sh_video->codec){ 1173 if(!sh_video->codec){
1174 if(force_vcodec!=-1) {
1175 sh_video->codec=NULL; /* re-search */
1176 printf("Can't find video codec for forced driver %d, defaulting to other drivers.\n",force_vcodec);
1177 force_vcodec=-1;
1178 continue;
1179 }
1171 printf("Can't find codec for video format 0x%X !\n",sh_video->format); 1180 printf("Can't find codec for video format 0x%X !\n",sh_video->format);
1172 printf("*** Try to upgrade %s from DOCS/codecs.conf\n",get_path("codecs.conf")); 1181 printf("*** Try to upgrade %s from DOCS/codecs.conf\n",get_path("codecs.conf"));
1173 printf("*** If it's still not OK, then read DOCS/CODECS!\n"); 1182 printf("*** If it's still not OK, then read DOCS/CODECS!\n");
1174 #ifdef HAVE_GUI 1183 #ifdef HAVE_GUI
1175 if ( !nogui ) 1184 if ( !nogui )
1179 usec_sleep( 10000 ); 1188 usec_sleep( 10000 );
1180 } 1189 }
1181 #endif 1190 #endif
1182 exit(1); 1191 exit(1);
1183 } 1192 }
1193 if(sh_video->codec->driver==force_vcodec) break; /* OK, we find our codec */
1194 if(force_vcodec!=-1&&sh_video->codec->driver!=force_vcodec) continue;
1184 if(!allow_dshow && sh_video->codec->driver==4) continue; // skip DShow 1195 if(!allow_dshow && sh_video->codec->driver==4) continue; // skip DShow
1185 break; 1196 break;
1186 } 1197 }
1187 //has_video=sh_video->codec->driver; 1198 //has_video=sh_video->codec->driver;
1188 1199