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

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

Issue 1172163004: Reformat existing code. There should be no functional effects. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 6 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 df37bec1116c912129bf8f5859f7cff7bd8fa4a0..3dcda29c87902478af856f258188f07665e7317e 100644
--- a/webrtc/modules/audio_coding/codecs/ilbc/test/iLBC_testLib.c
+++ b/webrtc/modules/audio_coding/codecs/ilbc/test/iLBC_testLib.c
@@ -42,6 +42,7 @@ int main(int argc, char* argv[])
FILE *ifileid,*efileid,*ofileid, *chfileid;
short encoded_data[55], data[240], speechType;
short len, mode, pli;
+ size_t readlen;
int blockcount = 0;
IlbcEncoderInstance *Enc_Inst;
@@ -125,19 +126,16 @@ int main(int argc, char* argv[])
/* loop over input blocks */
#ifdef SPLIT_10MS
- while(fread(data, sizeof(short), 80, ifileid) == 80) {
+ readlen = 80;
#else
- while((short)fread(data,sizeof(short),(mode<<3),ifileid)==(mode<<3)) {
+ readlen = (size_t)(mode << 3);
#endif
+ while(fread(data, sizeof(short), readlen, ifileid) == readlen) {
blockcount++;
/* encoding */
fprintf(stderr, "--- Encoding block %i --- ",blockcount);
-#ifdef SPLIT_10MS
- len=WebRtcIlbcfix_Encode(Enc_Inst, data, 80, encoded_data);
-#else
- len=WebRtcIlbcfix_Encode(Enc_Inst, data, (short)(mode<<3), encoded_data);
-#endif
+ len=WebRtcIlbcfix_Encode(Enc_Inst, data, (short)readlen, encoded_data);
if (len < 0) {
fprintf(stderr, "Error encoding\n");
exit(0);
@@ -152,9 +150,7 @@ int main(int argc, char* argv[])
/* write byte file */
if(len != 0){ //len may be 0 in 10ms split case
fwrite(encoded_data,1,len,efileid);
- }
- if(len != 0){ //len may be 0 in 10ms split case
/* get channel data if provided */
if (argc==6) {
if (fread(&pli, sizeof(int16_t), 1, chfileid)) {

Powered by Google App Engine
This is Rietveld 408576698