[MPlayer-cvslog] r25729 - trunk/stream/pnm.c
reimar
subversion at mplayerhq.hu
Sun Jan 13 14:25:07 CET 2008
Author: reimar
Date: Sun Jan 13 14:25:07 2008
New Revision: 25729
Log:
Use AV_WB*
Modified:
trunk/stream/pnm.c
Modified: trunk/stream/pnm.c
==============================================================================
--- trunk/stream/pnm.c (original)
+++ trunk/stream/pnm.c Sun Jan 13 14:25:07 2008
@@ -406,10 +406,8 @@ static int pnm_get_chunk(pnm_t *p,
static int pnm_write_chunk(uint16_t chunk_id, uint16_t length,
const char *chunk, char *data) {
- data[0]=(chunk_id>>8)%0xff;
- data[1]=chunk_id%0xff;
- data[2]=(length>>8)%0xff;
- data[3]=length%0xff;
+ AV_WB16(&data[0], chunk_id);
+ AV_WB16(&data[2], length);
memcpy(&data[4],chunk,length);
return length+4;
@@ -543,12 +541,7 @@ static int pnm_get_headers(pnm_t *p, int
}
/* set data offset */
- size--;
- prop_hdr[42]=(size>>24)%0xff;
- prop_hdr[43]=(size>>16)%0xff;
- prop_hdr[44]=(size>>8)%0xff;
- prop_hdr[45]=(size)%0xff;
- size++;
+ AV_WB32(&prop_hdr[42], size - 1);
/* read challenge */
memcpy (p->buffer, ptr, PREAMBLE_SIZE);
More information about the MPlayer-cvslog
mailing list