Mercurial > mplayer.hg
changeset 23312:f625b826ec32
Reuse AV_RL macros in ogg demuxer instead of its own overcomplicated implementations of it.
author | reimar |
---|---|
date | Thu, 17 May 2007 13:07:15 +0000 |
parents | 069e8d396198 |
children | d2f0839dc721 |
files | libmpdemux/demux_ogg.c |
diffstat | 1 files changed, 4 insertions(+), 49 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_ogg.c Thu May 17 12:56:08 2007 +0000 +++ b/libmpdemux/demux_ogg.c Thu May 17 13:07:15 2007 +0000 @@ -13,6 +13,7 @@ #include "stream/stream.h" #include "demuxer.h" #include "stheader.h" +#include "libavutil/intreadwrite.h" #define FOURCC_VORBIS mmioFOURCC('v', 'r', 'b', 's') #define FOURCC_SPEEX mmioFOURCC('s', 'p', 'x', ' ') @@ -159,55 +160,9 @@ extern subtitle* vo_sub; //FILE* subout; -static -uint16_t get_uint16 (const void *buf) -{ - uint16_t ret; - unsigned char *tmp; - - tmp = (unsigned char *) buf; - - ret = tmp[1] & 0xff; - ret = (ret << 8) + (tmp[0] & 0xff); - - return (ret); -} - -static -uint32_t get_uint32 (const void *buf) -{ - uint32_t ret; - unsigned char *tmp; - - tmp = (unsigned char *) buf; - - ret = tmp[3] & 0xff; - ret = (ret << 8) + (tmp[2] & 0xff); - ret = (ret << 8) + (tmp[1] & 0xff); - ret = (ret << 8) + (tmp[0] & 0xff); - - return (ret); -} - -static -uint64_t get_uint64 (const void *buf) -{ - uint64_t ret; - unsigned char *tmp; - - tmp = (unsigned char *) buf; - - ret = tmp[7] & 0xff; - ret = (ret << 8) + (tmp[6] & 0xff); - ret = (ret << 8) + (tmp[5] & 0xff); - ret = (ret << 8) + (tmp[4] & 0xff); - ret = (ret << 8) + (tmp[3] & 0xff); - ret = (ret << 8) + (tmp[2] & 0xff); - ret = (ret << 8) + (tmp[1] & 0xff); - ret = (ret << 8) + (tmp[0] & 0xff); - - return (ret); -} +#define get_uint16(b) AV_RL16(b) +#define get_uint32(b) AV_RL32(b) +#define get_uint64(b) AV_RL64(b) void demux_ogg_add_sub (ogg_stream_t* os,ogg_packet* pack) { int lcv;