summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohamed Tarek <mt@rockbox.org>2009-08-06 05:45:54 +0000
committerMohamed Tarek <mt@rockbox.org>2009-08-06 05:45:54 +0000
commitcc68b632cb6134ad158b1f15871809f00e8673d4 (patch)
treee3e05b29ef4d42c790433dfe3214b8f372aaede5
parent0f70c4d4ccf6eaef42ac2b2ba433278c61d59845 (diff)
downloadrockbox-cc68b632cb6134ad158b1f15871809f00e8673d4.tar.gz
rockbox-cc68b632cb6134ad158b1f15871809f00e8673d4.zip
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
-rw-r--r--apps/codecs/a52_rm.c1
-rw-r--r--apps/metadata/rm.c14
2 files changed, 14 insertions, 1 deletions
diff --git a/apps/codecs/a52_rm.c b/apps/codecs/a52_rm.c
index ae4f542b02..50269aea9d 100644
--- a/apps/codecs/a52_rm.c
+++ b/apps/codecs/a52_rm.c
@@ -45,6 +45,7 @@ static void init_rm(RMContext *rmctx)
45/* used outside liba52 */ 45/* used outside liba52 */
46static uint8_t buf[3840] IBSS_ATTR; 46static uint8_t buf[3840] IBSS_ATTR;
47 47
48/* The following two functions, a52_decode_data and output_audio are taken from apps/codecs/a52.c */
48static inline void output_audio(sample_t *samples) 49static inline void output_audio(sample_t *samples)
49{ 50{
50 ci->yield(); 51 ci->yield();
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 @@
38#define DEBUGF(...) 38#define DEBUGF(...)
39#endif 39#endif
40 40
41#ifdef DEBUG_RM
42static uint16_t get_uint16be(uint8_t *buf)
43{
44 return (uint16_t)((buf[0] << 8)|buf[1]);
45}
46
47static uint32_t get_uint32be(uint8_t *buf)
48{
49 return (uint32_t)((buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]);
50}
51#endif
52
41static inline void print_cook_extradata(RMContext *rmctx) { 53static inline void print_cook_extradata(RMContext *rmctx) {
42 54
43 DEBUGF(" cook_version = 0x%08x\n", get_uint32be(rmctx->codec_extradata)); 55 DEBUGF(" cook_version = 0x%08lx\n", get_uint32be(rmctx->codec_extradata));
44 DEBUGF(" samples_per_frame_per_channel = %d\n", get_uint16be(&rmctx->codec_extradata[4])); 56 DEBUGF(" samples_per_frame_per_channel = %d\n", get_uint16be(&rmctx->codec_extradata[4]));
45 DEBUGF(" number_of_subbands_in_freq_domain = %d\n", get_uint16be(&rmctx->codec_extradata[6])); 57 DEBUGF(" number_of_subbands_in_freq_domain = %d\n", get_uint16be(&rmctx->codec_extradata[6]));
46 if(rmctx->extradata_size == 16) { 58 if(rmctx->extradata_size == 16) {