diff options
author | 2001-07-12 15:10:06 +0000 | |
---|---|---|
committer | 2001-07-12 15:10:06 +0000 | |
commit | 88b34d0d112d73462f36e003ea788d6adb2211a2 (patch) | |
tree | 4ca4dd8145e397a465ba2ee84bc73bf8f7a4db20 /codec-cfg.c | |
parent | 796cc66970419695911bf5839f6ecd1552584d49 (diff) |
Use FOURCC macro to encode fcc values. Avoids accessing 32-bit data from
unaligned memory locations and improves portability
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1306 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'codec-cfg.c')
-rw-r--r-- | codec-cfg.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/codec-cfg.c b/codec-cfg.c index 9da6fedea7..a2723c0614 100644 --- a/codec-cfg.c +++ b/codec-cfg.c @@ -15,6 +15,9 @@ #include <assert.h> #include <string.h> +#include "loader.h" // loader+avifmt for mmioFOURCC +#include "wine/avifmt.h" + #include "libvo/img_format.h" #include "codec-cfg.h" @@ -34,7 +37,7 @@ static int add_to_fourcc(char *s, char *alias, unsigned int *fourcc, unsigned int *map) { int i, j, freeslots; - char **aliasp; + char *aliasp; unsigned int tmp; /* find first unused slot */ @@ -44,14 +47,14 @@ static int add_to_fourcc(char *s, char *alias, unsigned int *fourcc, if (!freeslots) goto err_out_too_many; - aliasp = (alias) ? &alias : &s; + aliasp = (alias) ? alias : s; do { - tmp = *((unsigned int *) s); + tmp = mmioFOURCC(s[0], s[1], s[2], s[3]); for (j = 0; j < i; j++) if (tmp == fourcc[j]) goto err_out_duplicated; fourcc[i] = tmp; - map[i] = *((unsigned int *) (*aliasp)); + map[i] = mmioFOURCC(aliasp[0], aliasp[1], aliasp[2], aliasp[3]); s += 4; i++; } while ((*(s++) == ',') && --freeslots); |