summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-08-30 23:56:24 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-08-30 23:56:24 +0000
commit0446e090b1185e9773c77adad46bd5159acc8222 (patch)
tree04ba6c5b2e856501021a96ddc9a650cf5bf761f2 /libmpcodecs
parentc1f2df8f53deced39e181ce8e6ef6aaa41256781 (diff)
downloadmpv-0446e090b1185e9773c77adad46bd5159acc8222.tar.bz2
mpv-0446e090b1185e9773c77adad46bd5159acc8222.tar.xz
Allow forcing of demuxers and codecs by prepending '+'
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16322 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/dec_audio.c11
-rw-r--r--libmpcodecs/dec_video.c11
2 files changed, 16 insertions, 6 deletions
diff --git a/libmpcodecs/dec_audio.c b/libmpcodecs/dec_audio.c
index 7954399546..7a1259e4aa 100644
--- a/libmpcodecs/dec_audio.c
+++ b/libmpcodecs/dec_audio.c
@@ -119,6 +119,11 @@ int init_audio_codec(sh_audio_t *sh_audio)
int init_audio(sh_audio_t *sh_audio,char* codecname,char* afm,int status){
unsigned int orig_fourcc=sh_audio->wf?sh_audio->wf->wFormatTag:0;
+ int force = 0;
+ if (codecname && codecname[0] == '+') {
+ codecname = &codecname[1];
+ force = 1;
+ }
sh_audio->codec=NULL;
while(1){
ad_functions_t* mpadec;
@@ -126,14 +131,14 @@ int init_audio(sh_audio_t *sh_audio,char* codecname,char* afm,int status){
sh_audio->ad_driver = 0;
// restore original fourcc:
if(sh_audio->wf) sh_audio->wf->wFormatTag=i=orig_fourcc;
- if(!(sh_audio->codec=find_codec(sh_audio->format,
- sh_audio->wf?(&i):NULL, sh_audio->codec,1) )) break;
+ if(!(sh_audio->codec=find_audio_codec(sh_audio->format,
+ sh_audio->wf?(&i):NULL, sh_audio->codec, force) )) break;
if(sh_audio->wf) sh_audio->wf->wFormatTag=i;
// ok we found one codec
if(sh_audio->codec->flags&CODECS_FLAG_SELECTED) continue; // already tried & failed
if(codecname && strcmp(sh_audio->codec->name,codecname)) continue; // -ac
if(afm && strcmp(sh_audio->codec->drv,afm)) continue; // afm doesn't match
- if(sh_audio->codec->status<status) continue; // too unstable
+ if(!force && sh_audio->codec->status<status) continue; // too unstable
sh_audio->codec->flags|=CODECS_FLAG_SELECTED; // tagging it
// ok, it matches all rules, let's find the driver!
for (i=0; mpcodecs_ad_drivers[i] != NULL; i++)
diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c
index 3e56a622f7..b25b1c7a8b 100644
--- a/libmpcodecs/dec_video.c
+++ b/libmpcodecs/dec_video.c
@@ -166,19 +166,24 @@ int init_video(sh_video_t *sh_video,char* codecname,char* vfm,int status){
unsigned int orig_fourcc=sh_video->bih?sh_video->bih->biCompression:0;
sh_video->codec=NULL;
sh_video->vf_inited=0;
+ int force = 0;
+ if (codecname && codecname[0] == '+') {
+ codecname = &codecname[1];
+ force = 1;
+ }
while(1){
int i;
// restore original fourcc:
if(sh_video->bih) sh_video->bih->biCompression=orig_fourcc;
- if(!(sh_video->codec=find_codec(sh_video->format,
+ if(!(sh_video->codec=find_video_codec(sh_video->format,
sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL,
- sh_video->codec,0) )) break;
+ sh_video->codec,force) )) break;
// ok we found one codec
if(sh_video->codec->flags&CODECS_FLAG_SELECTED) continue; // already tried & failed
if(codecname && strcmp(sh_video->codec->name,codecname)) continue; // -vc
if(vfm && strcmp(sh_video->codec->drv,vfm)) continue; // vfm doesn't match
- if(sh_video->codec->status<status) continue; // too unstable
+ if(!force && sh_video->codec->status<status) continue; // too unstable
sh_video->codec->flags|=CODECS_FLAG_SELECTED; // tagging it
// ok, it matches all rules, let's find the driver!
for (i=0; mpcodecs_vd_drivers[i] != NULL; i++)