summaryrefslogtreecommitdiff
path: root/libavformat/ffm.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2007-07-06 09:32:34 +0000
committerDiego Biurrun <diego@biurrun.de>2007-07-06 09:32:34 +0000
commit80fb82346e6d680d2ccff761a578fe856ed3b54c (patch)
treeb6f45c841d9e30729aaf265e8dbd645bf5ff5b61 /libavformat/ffm.c
parent042ef4b720f5d3321d9b7eeeb2067c671d5aeefd (diff)
Use AV_RB* macros where appropriate.
patch by Ronald S. Bultje, rsbultje gmail com thread: Re: [FFmpeg-devel] remove int readers date: Sat, 23 Jun 2007 09:32:12 -0400 Originally committed as revision 9499 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/ffm.c')
-rw-r--r--libavformat/ffm.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/libavformat/ffm.c b/libavformat/ffm.c
index 22cdaf3091..53eb2b29dc 100644
--- a/libavformat/ffm.c
+++ b/libavformat/ffm.c
@@ -601,12 +601,12 @@ static int ffm_read_packet(AVFormatContext *s, AVPacket *pkt)
ffm->read_state = READ_DATA;
/* fall thru */
case READ_DATA:
- size = (ffm->header[2] << 16) | (ffm->header[3] << 8) | ffm->header[4];
+ size = AV_RB24(ffm->header + 2);
if (!ffm_is_avail_data(s, size)) {
return AVERROR(EAGAIN);
}
- duration = (ffm->header[5] << 16) | (ffm->header[6] << 8) | ffm->header[7];
+ duration = AV_RB24(ffm->header + 5);
av_new_packet(pkt, size);
pkt->stream_index = ffm->header[0];
@@ -714,15 +714,10 @@ static int ffm_seek(AVFormatContext *s, int stream_index, int64_t wanted_pts, in
offset_t ffm_read_write_index(int fd)
{
uint8_t buf[8];
- offset_t pos;
- int i;
lseek(fd, 8, SEEK_SET);
read(fd, buf, 8);
- pos = 0;
- for(i=0;i<8;i++)
- pos |= (int64_t)buf[i] << (56 - i * 8);
- return pos;
+ return AV_RB64(buf);
}
void ffm_write_write_index(int fd, offset_t pos)