diff options
author | Mohamed Tarek <mt@rockbox.org> | 2009-07-06 22:40:45 +0000 |
---|---|---|
committer | Mohamed Tarek <mt@rockbox.org> | 2009-07-06 22:40:45 +0000 |
commit | e184ef1027ba8f41aca65dbae2af05662b23c722 (patch) | |
tree | b7b108acf795d52e0c4f9f841906b02d1df3f773 /apps/codecs/libcook/cook.c | |
parent | 03fe562a95a2b4fe4b3e316d3877140c3b4c822f (diff) | |
download | rockbox-e184ef1027ba8f41aca65dbae2af05662b23c722.tar.gz rockbox-e184ef1027ba8f41aca65dbae2af05662b23c722.zip |
Adding support for rm playback. Only cook codec is supported for now and no seeking.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21695 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libcook/cook.c')
-rw-r--r-- | apps/codecs/libcook/cook.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/apps/codecs/libcook/cook.c b/apps/codecs/libcook/cook.c index 8caa3992bd..ba5fbab6a1 100644 --- a/apps/codecs/libcook/cook.c +++ b/apps/codecs/libcook/cook.c | |||
@@ -21,7 +21,7 @@ | |||
21 | */ | 21 | */ |
22 | 22 | ||
23 | /** | 23 | /** |
24 | * @file libavcodec/cook.c | 24 | * @file cook.c |
25 | * Cook compatible decoder. Bastardization of the G.722.1 standard. | 25 | * Cook compatible decoder. Bastardization of the G.722.1 standard. |
26 | * This decoder handles RealNetworks, RealAudio G2 data. | 26 | * This decoder handles RealNetworks, RealAudio G2 data. |
27 | * Cook is identified by the codec name cook in RM files. | 27 | * Cook is identified by the codec name cook in RM files. |
@@ -60,16 +60,15 @@ | |||
60 | #define SUBBAND_SIZE 20 | 60 | #define SUBBAND_SIZE 20 |
61 | #define MAX_SUBPACKETS 5 | 61 | #define MAX_SUBPACKETS 5 |
62 | //#define COOKDEBUG | 62 | //#define COOKDEBUG |
63 | #if 0 | 63 | #ifndef COOKDEBUG |
64 | #define DEBUGF(message,args ...) printf | 64 | #undef DEBUGF |
65 | #else | ||
66 | #define DEBUGF(...) | 65 | #define DEBUGF(...) |
67 | #endif | 66 | #endif |
68 | 67 | ||
69 | /** | 68 | /** |
70 | * Random bit stream generator. | 69 | * Random bit stream generator. |
71 | */ | 70 | */ |
72 | static int inline cook_random(COOKContext *q) | 71 | static inline int cook_random(COOKContext *q) |
73 | { | 72 | { |
74 | q->random_state = | 73 | q->random_state = |
75 | q->random_state * 214013 + 2531011; /* typical RNG numbers */ | 74 | q->random_state * 214013 + 2531011; /* typical RNG numbers */ |
@@ -200,7 +199,7 @@ static void decode_gain_info(GetBitContext *gb, int *gaininfo) | |||
200 | i = 0; | 199 | i = 0; |
201 | while (n--) { | 200 | while (n--) { |
202 | int index = get_bits(gb, 3); | 201 | int index = get_bits(gb, 3); |
203 | int gain = get_bits1(gb) ? get_bits(gb, 4) - 7 : -1; | 202 | int gain = get_bits1(gb) ? (int)get_bits(gb, 4) - 7 : -1; |
204 | 203 | ||
205 | while (i <= index) gaininfo[i++] = gain; | 204 | while (i <= index) gaininfo[i++] = gain; |
206 | } | 205 | } |
@@ -789,7 +788,7 @@ int cook_decode_init(RMContext *rmctx, COOKContext *q) | |||
789 | return -1; | 788 | return -1; |
790 | 789 | ||
791 | 790 | ||
792 | if(q->block_align >= UINT_MAX/2) | 791 | if(rmctx->block_align >= UINT16_MAX/2) |
793 | return -1; | 792 | return -1; |
794 | 793 | ||
795 | q->gains1.now = q->gain_1; | 794 | q->gains1.now = q->gain_1; |