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

Side by Side Diff: media/tools/wav_ola_test.cc

Issue 155160: Test fwrite returnval in wav_ola_test.cc to fix ubuntu compile warning. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This application is a test for AudioRendererAlgorithmOLA. It reads in a 5 // This application is a test for AudioRendererAlgorithmOLA. It reads in a
6 // specified wav file (so far only 8, 16 and 32 bit are supported) and uses 6 // specified wav file (so far only 8, 16 and 32 bit are supported) and uses
7 // ARAO to scale the playback by a specified rate. Then it outputs the result 7 // ARAO to scale the playback by a specified rate. Then it outputs the result
8 // to the specified location. Command line calls should be as follows: 8 // to the specified location. Command line calls should be as follows:
9 // 9 //
10 // wav_ola_test RATE INFILE OUTFILE 10 // wav_ola_test RATE INFILE OUTFILE
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } else { 140 } else {
141 bytes_written += bytes; 141 bytes_written += bytes;
142 } 142 }
143 } 143 }
144 144
145 // Seek back to the beginning of our output file and update the header. 145 // Seek back to the beginning of our output file and update the header.
146 wav.chunk_size = 36 + bytes_written; 146 wav.chunk_size = 36 + bytes_written;
147 wav.subchunk1_size = 16; 147 wav.subchunk1_size = 16;
148 wav.subchunk2_size = bytes_written; 148 wav.subchunk2_size = bytes_written;
149 fseek(output.get(), 0, SEEK_SET); 149 fseek(output.get(), 0, SEEK_SET);
150 fwrite(&wav, sizeof(wav), 1, output.get()); 150 if (fwrite(&wav, sizeof(wav), 1, output.get()) < 1) {
151 LOG(ERROR) << "could not write wav header.";
152 return 1;
153 }
151 154
152 return 0; 155 return 0;
153 } 156 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698