summaryrefslogtreecommitdiffstats
path: root/codec-cfg.c
diff options
context:
space:
mode:
authorarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-06 23:56:42 +0000
committerarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-06 23:56:42 +0000
commit4eb3b624c843c0d31f1431bc2f7ed1b9966c6220 (patch)
treea8072510f0e872956f68dbfb435313e9180eb8e1 /codec-cfg.c
parent4d14bf1ddb4f0f75c2d19a445a0a66e80e38f8f9 (diff)
downloadmpv-4eb3b624c843c0d31f1431bc2f7ed1b9966c6220.tar.bz2
mpv-4eb3b624c843c0d31f1431bc2f7ed1b9966c6220.tar.xz
outflags[] reading fixed
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@300 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'codec-cfg.c')
-rw-r--r--codec-cfg.c42
1 files changed, 38 insertions, 4 deletions
diff --git a/codec-cfg.c b/codec-cfg.c
index af067e585d..e1c6449b55 100644
--- a/codec-cfg.c
+++ b/codec-cfg.c
@@ -138,12 +138,24 @@ int add_to_format(char *s, unsigned int *format)
return 1;
}
+/*
short get_flags(char *s)
{
+ static char *flagstr[] = {
+ "flip",
+ "noflip",
+ "yuvhack",
+ NULL
+ };
+ int j;
+
+ printf("flags='%s'\n",s);
+
if (!s)
return 0;
return 1;
}
+*/
int add_to_out(char *sfmt, char *sflags, unsigned int *outfmt,
unsigned char *outflags)
@@ -177,6 +189,13 @@ int add_to_out(char *sfmt, char *sflags, unsigned int *outfmt,
IMGFMT_BGR|24,
IMGFMT_BGR|32
};
+ static char *flagstr[] = {
+ "flip",
+ "noflip",
+ "yuvhack",
+ NULL
+ };
+
int i, j;
unsigned char flags;
@@ -187,20 +206,30 @@ int add_to_out(char *sfmt, char *sflags, unsigned int *outfmt,
return 0;
}
- flags = get_flags(sflags);
+ flags = 0; //get_flags(sflags);
+ if(sflags) do {
+ for (j = 0; flagstr[j] != NULL; j++)
+ if (!strncmp(sflags, flagstr[j], strlen(flagstr[j])))
+ break;
+ if (flagstr[j] == NULL) return 0; // error!
+ flags|=(1<<j);
+ sflags+=strlen(flagstr[j]);
+ } while (*(sflags++) == ',');
+
do {
- for (j = 0; fmtstr[i] != NULL; j++)
+ for (j = 0; fmtstr[j] != NULL; j++)
if (!strncmp(sfmt, fmtstr[j], strlen(fmtstr[j])))
break;
if (fmtstr[j] == NULL)
return 0;
outfmt[i] = fmtnum[j];
outflags[i] = flags;
+ ++i;
sfmt+=strlen(fmtstr[j]);
} while (*(sfmt++) == ',');
- if (*(--sfmt) != '\0')
- return 0;
+ if (*(--sfmt) != '\0') return 0;
+
return 1;
}
@@ -460,6 +489,11 @@ int main(void)
printf("fourcc %02d: %08X (%.4s) ===> %08X (%.4s)\n",j,c->fourcc[j],&c->fourcc[j],c->fourccmap[j],&c->fourccmap[j]);
}
}
+ for(j=0;j<CODECS_MAX_OUTFMT;j++){
+ if(c->outfmt[j]!=0xFFFFFFFF){
+ printf("outfmt %02d: %08X (%.4s) flags: %d\n",j,c->outfmt[j],&c->outfmt[j],c->outflags[j]);
+ }
+ }
}
return 0;