summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-01-13 13:25:07 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-01-13 13:25:07 +0000
commit1ecb0fc00ba0e0753ee61f0492bfa20f275b35c3 (patch)
tree5b89018af059d8a203fec863c3d2cf6fa251eb1a /stream
parent7625d393348f619b8452aec0428e21e11c137073 (diff)
downloadmpv-1ecb0fc00ba0e0753ee61f0492bfa20f275b35c3.tar.bz2
mpv-1ecb0fc00ba0e0753ee61f0492bfa20f275b35c3.tar.xz
Use AV_WB*
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25729 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/pnm.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/stream/pnm.c b/stream/pnm.c
index 9d88040c0c..deb3ee8b4c 100644
--- a/stream/pnm.c
+++ b/stream/pnm.c
@@ -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 *need_response) {
}
/* 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);