Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(838)

Unified Diff: webrtc/modules/audio_coding/codecs/ilbc/test/iLBC_testLib.c

Issue 1230693002: Update audio code to use size_t more correctly, (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Review comments Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/codecs/ilbc/test/iLBC_testLib.c
diff --git a/webrtc/modules/audio_coding/codecs/ilbc/test/iLBC_testLib.c b/webrtc/modules/audio_coding/codecs/ilbc/test/iLBC_testLib.c
index b4e36b62947ca8269c71a260ef4973a836c752a4..f14192c2ae2cb1f82ba6cecd6a34164825b08c78 100644
--- a/webrtc/modules/audio_coding/codecs/ilbc/test/iLBC_testLib.c
+++ b/webrtc/modules/audio_coding/codecs/ilbc/test/iLBC_testLib.c
@@ -41,15 +41,15 @@ int main(int argc, char* argv[])
{
FILE *ifileid,*efileid,*ofileid, *chfileid;
short encoded_data[55], data[240], speechType;
- int len;
- short mode, pli;
- size_t readlen;
+ int len_int, mode;
+ short pli;
+ size_t len, readlen;
int blockcount = 0;
IlbcEncoderInstance *Enc_Inst;
IlbcDecoderInstance *Dec_Inst;
#ifdef JUNK_DATA
- int i;
+ size_t i;
FILE *seedfile;
unsigned int random_seed = (unsigned int) time(NULL);//1196764538
#endif
@@ -136,11 +136,12 @@ int main(int argc, char* argv[])
/* encoding */
fprintf(stderr, "--- Encoding block %i --- ",blockcount);
- len=WebRtcIlbcfix_Encode(Enc_Inst, data, (short)readlen, encoded_data);
- if (len < 0) {
+ len_int=WebRtcIlbcfix_Encode(Enc_Inst, data, readlen, encoded_data);
+ if (len_int < 0) {
fprintf(stderr, "Error encoding\n");
exit(0);
}
+ len = (size_t)len_int;
fprintf(stderr, "\r");
#ifdef JUNK_DATA
@@ -174,12 +175,13 @@ int main(int argc, char* argv[])
/* decoding */
fprintf(stderr, "--- Decoding block %i --- ",blockcount);
if (pli==1) {
- len=WebRtcIlbcfix_Decode(Dec_Inst, encoded_data, (int16_t)len, data,
- &speechType);
- if (len < 0) {
+ len_int = WebRtcIlbcfix_Decode(Dec_Inst, encoded_data, len, data,
+ &speechType);
+ if (len_int < 0) {
fprintf(stderr, "Error decoding\n");
exit(0);
}
+ len = (size_t)len_int;
} else {
len=WebRtcIlbcfix_DecodePlc(Dec_Inst, data, 1);
}
« no previous file with comments | « webrtc/modules/audio_coding/codecs/ilbc/test/iLBC_test.c ('k') | webrtc/modules/audio_coding/codecs/ilbc/window32_w32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698