OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 "failed to retrieve file size with stat!"); | 1449 "failed to retrieve file size with stat!"); |
1450 return -1; | 1450 return -1; |
1451 } | 1451 } |
1452 FileWrapper* inStreamObj = FileWrapper::Create(); | 1452 FileWrapper* inStreamObj = FileWrapper::Create(); |
1453 if(inStreamObj == NULL) | 1453 if(inStreamObj == NULL) |
1454 { | 1454 { |
1455 WEBRTC_TRACE(kTraceMemory, kTraceFile, _id, | 1455 WEBRTC_TRACE(kTraceMemory, kTraceFile, _id, |
1456 "failed to create InStream object!"); | 1456 "failed to create InStream object!"); |
1457 return -1; | 1457 return -1; |
1458 } | 1458 } |
1459 if(inStreamObj->OpenFile(fileName, true) == -1) | 1459 if (!inStreamObj->OpenFile(fileName, true)) { |
1460 { | 1460 delete inStreamObj; |
1461 delete inStreamObj; | 1461 WEBRTC_TRACE(kTraceError, kTraceFile, _id, "failed to open file %s!", |
1462 WEBRTC_TRACE(kTraceError, kTraceFile, _id, | 1462 fileName); |
1463 "failed to open file %s!", fileName); | 1463 return -1; |
1464 return -1; | |
1465 } | 1464 } |
1466 | 1465 |
1467 switch (fileFormat) | 1466 switch (fileFormat) |
1468 { | 1467 { |
1469 case kFileFormatWavFile: | 1468 case kFileFormatWavFile: |
1470 { | 1469 { |
1471 if(ReadWavHeader(*inStreamObj) == -1) | 1470 if(ReadWavHeader(*inStreamObj) == -1) |
1472 { | 1471 { |
1473 WEBRTC_TRACE(kTraceError, kTraceFile, _id, | 1472 WEBRTC_TRACE(kTraceError, kTraceFile, _id, |
1474 "failed to read WAV file header!"); | 1473 "failed to read WAV file header!"); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1550 } | 1549 } |
1551 | 1550 |
1552 uint32_t ModuleFileUtility::PlayoutPositionMs() | 1551 uint32_t ModuleFileUtility::PlayoutPositionMs() |
1553 { | 1552 { |
1554 WEBRTC_TRACE(kTraceStream, kTraceFile, _id, | 1553 WEBRTC_TRACE(kTraceStream, kTraceFile, _id, |
1555 "ModuleFileUtility::PlayoutPosition()"); | 1554 "ModuleFileUtility::PlayoutPosition()"); |
1556 | 1555 |
1557 return _reading ? _playoutPositionMs : 0; | 1556 return _reading ? _playoutPositionMs : 0; |
1558 } | 1557 } |
1559 } // namespace webrtc | 1558 } // namespace webrtc |
OLD | NEW |