summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/audioop.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/Modules/audioop.c b/Modules/audioop.c
index 792c4ae..f8810d3 100644
--- a/Modules/audioop.c
+++ b/Modules/audioop.c
@@ -731,11 +731,6 @@ audioop_lin2adpcm3(self, args)
return 0;
}
- str = newsizedstringobject(NULL, len/size);
- if ( str == 0 )
- return 0;
- ncp = (signed char *)getstringvalue(str);
-
/* Decode state, should have (value, step) */
if ( state == None ) {
/* First time, it seems. Set defaults */
@@ -744,6 +739,11 @@ audioop_lin2adpcm3(self, args)
} else if ( !getargs(state, "(ii)", &valprev, &step) )
return 0;
+ str = newsizedstringobject(NULL, len/size);
+ if ( str == 0 )
+ return 0;
+ ncp = (signed char *)getstringvalue(str);
+
for ( i=0; i < len; i += size ) {
if ( size == 1 ) val = ((int)*CHARP(cp, i)) << 8;
else if ( size == 2 ) val = (int)*SHORTP(cp, i);
@@ -861,11 +861,6 @@ audioop_lin2adpcm(self, args)
return 0;
}
- str = newsizedstringobject(NULL, len/(size*2));
- if ( str == 0 )
- return 0;
- ncp = (signed char *)getstringvalue(str);
-
/* Decode state, should have (value, step) */
if ( state == None ) {
/* First time, it seems. Set defaults */
@@ -875,6 +870,11 @@ audioop_lin2adpcm(self, args)
} else if ( !getargs(state, "(ii)", &valpred, &index) )
return 0;
+ str = newsizedstringobject(NULL, len/(size*2));
+ if ( str == 0 )
+ return 0;
+ ncp = (signed char *)getstringvalue(str);
+
step = stepsizeTable[index];
bufferstep = 1;