# HG changeset patch # User reimar # Date 1179407235 0 # Node ID f625b826ec32b1647640b96318bd510d91c5c626 # Parent 069e8d396198d9a0037e757c513df2934c7cac14 Reuse AV_RL macros in ogg demuxer instead of its own overcomplicated implementations of it. diff -r 069e8d396198 -r f625b826ec32 libmpdemux/demux_ogg.c --- 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;