[Mplayer-cvslog] CVS: main codec-cfg.c,1.25,1.26
Jürgen Keil
jkeil at mplayer.dev.hu
Thu Jul 12 17:10:08 CEST 2001
Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv19891
Modified Files:
codec-cfg.c
Log Message:
Use FOURCC macro to encode fcc values. Avoids accessing 32-bit data from
unaligned memory locations and improves portability
Index: codec-cfg.c
===================================================================
RCS file: /cvsroot/mplayer/main/codec-cfg.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- codec-cfg.c 8 Jul 2001 17:20:46 -0000 1.25
+++ codec-cfg.c 12 Jul 2001 15:10:06 -0000 1.26
@@ -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 @@
unsigned int *map)
{
int i, j, freeslots;
- char **aliasp;
+ char *aliasp;
unsigned int tmp;
/* find first unused slot */
@@ -44,14 +47,14 @@
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);
More information about the MPlayer-cvslog
mailing list