From cc68b632cb6134ad158b1f15871809f00e8673d4 Mon Sep 17 00:00:00 2001 From: Mohamed Tarek Date: Thu, 6 Aug 2009 05:45:54 +0000 Subject: Add a couple of functions for the rm metadata parser for debugging, and add a comment to codecs/a52_rm.c to indicate the source of the decode function. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22182 a1c6a512-1295-4272-9138-f99709370657 --- apps/metadata/rm.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'apps/metadata/rm.c') diff --git a/apps/metadata/rm.c b/apps/metadata/rm.c index c74acef5dd..7ab85794ff 100644 --- a/apps/metadata/rm.c +++ b/apps/metadata/rm.c @@ -38,9 +38,21 @@ #define DEBUGF(...) #endif +#ifdef DEBUG_RM +static uint16_t get_uint16be(uint8_t *buf) +{ + return (uint16_t)((buf[0] << 8)|buf[1]); +} + +static uint32_t get_uint32be(uint8_t *buf) +{ + return (uint32_t)((buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]); +} +#endif + static inline void print_cook_extradata(RMContext *rmctx) { - DEBUGF(" cook_version = 0x%08x\n", get_uint32be(rmctx->codec_extradata)); + DEBUGF(" cook_version = 0x%08lx\n", get_uint32be(rmctx->codec_extradata)); DEBUGF(" samples_per_frame_per_channel = %d\n", get_uint16be(&rmctx->codec_extradata[4])); DEBUGF(" number_of_subbands_in_freq_domain = %d\n", get_uint16be(&rmctx->codec_extradata[6])); if(rmctx->extradata_size == 16) { -- cgit v1.2.3