summaryrefslogtreecommitdiffstats
path: root/mencoder.c
diff options
context:
space:
mode:
authoratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-24 14:01:55 +0000
committeratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-24 14:01:55 +0000
commita353d784a81088dace6941547480eae9efc384b3 (patch)
tree8e745b6690e5d01e82f074c35448f2527f98befc /mencoder.c
parentffde90d47e0a721ed541a456c58cc913283eacc8 (diff)
downloadmpv-a353d784a81088dace6941547480eae9efc384b3.tar.bz2
mpv-a353d784a81088dace6941547480eae9efc384b3.tar.xz
fixed priority support, tested with -vfm -vc, etc.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3713 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mencoder.c')
-rw-r--r--mencoder.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/mencoder.c b/mencoder.c
index 29f1ebb763..f1588f393e 100644
--- a/mencoder.c
+++ b/mencoder.c
@@ -411,7 +411,7 @@ sh_video->codec=NULL;
if(out_video_codec>1){
if(video_family!=-1) mp_msg(MSGT_MENCODER,MSGL_INFO,MSGTR_TryForceVideoFmt,video_family);
-{
+{ /* local vars */
short bestprio=-1;
struct codecs_st *bestcodec=NULL;
while(1){
@@ -419,23 +419,28 @@ while(1){
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 */
+ //sh_video->codec=NULL; /* re-search */
mp_msg(MSGT_MENCODER,MSGL_WARN,MSGTR_CantFindVfmtFallback);
video_family=-1;
continue;
}
- mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantFindVideoCodec,sh_video->format);
- mp_msg(MSGT_MENCODER,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf"));
- exit(1);
- }
- if(video_codec && strcmp(sh_video->codec->name,video_codec)) continue;
- else if(video_family!=-1 && sh_video->codec->driver!=video_family) continue;
- else if(sh_video->codec && sh_video->codec->priority > bestprio) {
- //printf("\n\n!!! setting bestprio from %d to %d for %s!!!\n\n", bestprio, sh_video->codec->priority, sh_video->codec->name);
- bestprio=sh_video->codec->priority;
- bestcodec=sh_video->codec;
- continue;
- }
+ if(bestprio==-1 || !video_codec) {
+ mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantFindVideoCodec,sh_video->format);
+ mp_msg(MSGT_MENCODER,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf"));
+ exit(1);
+ }
+ } else {
+ if(video_codec && strcmp(sh_video->codec->name,video_codec)) continue;
+ else if(video_family!=-1 && sh_video->codec->driver!=video_family) continue;
+ else if(video_family==-1 && !video_codec && sh_video->codec->priority) {
+ if(sh_video->codec->priority > bestprio) {
+ //printf("\n\n!!! setting bestprio from %d to %d for %s!!!\n\n", bestprio, sh_video->codec->priority, sh_video->codec->name);
+ bestprio=sh_video->codec->priority;
+ bestcodec=sh_video->codec;
+ }
+ continue;
+ }
+ } /* sh_video->codec */
break;
}
if(bestprio!=-1) {
@@ -443,7 +448,7 @@ if(bestprio!=-1) {
sh_video->codec=bestcodec;
}
-}
+} /* end local vars */
mp_msg(MSGT_MENCODER,MSGL_INFO,"%s video codec: [%s] drv:%d prio:%d (%s)\n",video_codec?"Forcing":"Detected",sh_video->codec->name,sh_video->codec->driver,sh_video->codec->priority!=-1?sh_video->codec->priority:0,sh_video->codec->info);