summaryrefslogtreecommitdiff
path: root/apps/codecs/libcook/cook.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libcook/cook.c')
-rw-r--r--apps/codecs/libcook/cook.c15
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 */
72static int inline cook_random(COOKContext *q) 71static 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;