| Index: webrtc/modules/media_file/media_file_utility.cc
|
| diff --git a/webrtc/modules/media_file/media_file_utility.cc b/webrtc/modules/media_file/media_file_utility.cc
|
| index ae8d06f634054ef7738167840c6e9a2c45e33a7d..49260471db1fe1e9b964be485bea8fad2883de51 100644
|
| --- a/webrtc/modules/media_file/media_file_utility.cc
|
| +++ b/webrtc/modules/media_file/media_file_utility.cc
|
| @@ -425,11 +425,10 @@ int32_t ModuleFileUtility::ReadWavDataAsMono(
|
| "ReadWavDataAsMono: output buffer is too short!");
|
| return -1;
|
| }
|
| - if(outData == NULL)
|
| - {
|
| - WEBRTC_TRACE(kTraceError, kTraceFile, _id,
|
| - "ReadWavDataAsMono: output buffer NULL!");
|
| - return -1;
|
| + if (outData == nullptr) {
|
| + WEBRTC_TRACE(kTraceError, kTraceFile, _id,
|
| + "ReadWavDataAsMono: output buffer null!");
|
| + return -1;
|
| }
|
|
|
| if(!_reading)
|
| @@ -494,12 +493,10 @@ int32_t ModuleFileUtility::ReadWavDataAsStereo(
|
| outDataRight,
|
| bufferSize);
|
|
|
| - if((outDataLeft == NULL) ||
|
| - (outDataRight == NULL))
|
| - {
|
| - WEBRTC_TRACE(kTraceError, kTraceFile, _id,
|
| - "ReadWavDataAsMono: an input buffer is NULL!");
|
| - return -1;
|
| + if ((outDataLeft == nullptr) || (outDataRight == nullptr)) {
|
| + WEBRTC_TRACE(kTraceError, kTraceFile, _id,
|
| + "ReadWavDataAsMono: an input buffer is null!");
|
| + return -1;
|
| }
|
| if(codec_info_.channels != 2)
|
| {
|
| @@ -580,12 +577,10 @@ int32_t ModuleFileUtility::ReadWavData(InStream& wav,
|
| "ModuleFileUtility::ReadWavData(wav= 0x%x, buffer= 0x%x, "
|
| "dataLen= %" PRIuS ")", &wav, buffer, dataLengthInBytes);
|
|
|
| -
|
| - if(buffer == NULL)
|
| - {
|
| - WEBRTC_TRACE(kTraceError, kTraceFile, _id,
|
| - "ReadWavDataAsMono: output buffer NULL!");
|
| - return -1;
|
| + if (buffer == nullptr) {
|
| + WEBRTC_TRACE(kTraceError, kTraceFile, _id,
|
| + "ReadWavDataAsMono: output buffer null!");
|
| + return -1;
|
| }
|
|
|
| // Make sure that a read won't return too few samples.
|
| @@ -711,11 +706,10 @@ int32_t ModuleFileUtility::WriteWavData(OutStream& out,
|
| "ModuleFileUtility::WriteWavData(out= 0x%x, buf= 0x%x, "
|
| "dataLen= %" PRIuS ")", &out, buffer, dataLength);
|
|
|
| - if(buffer == NULL)
|
| - {
|
| - WEBRTC_TRACE(kTraceError, kTraceFile, _id,
|
| - "WriteWavData: input buffer NULL!");
|
| - return -1;
|
| + if (buffer == nullptr) {
|
| + WEBRTC_TRACE(kTraceError, kTraceFile, _id,
|
| + "WriteWavData: input buffer null!");
|
| + return -1;
|
| }
|
|
|
| if(!out.Write(buffer, dataLength))
|
| @@ -815,9 +809,8 @@ int32_t ModuleFileUtility::ReadPreEncodedData(
|
| "outData= 0x%x, bufferSize= %" PRIuS ")", &in, outData,
|
| bufferSize);
|
|
|
| - if(outData == NULL)
|
| - {
|
| - WEBRTC_TRACE(kTraceError, kTraceFile, _id, "output buffer NULL");
|
| + if (outData == nullptr) {
|
| + WEBRTC_TRACE(kTraceError, kTraceFile, _id, "output buffer null");
|
| }
|
|
|
| size_t frameLen;
|
| @@ -874,9 +867,8 @@ int32_t ModuleFileUtility::WritePreEncodedData(
|
| "inData= 0x%x, dataLen= %" PRIuS ")", &out, buffer,
|
| dataLength);
|
|
|
| - if(buffer == NULL)
|
| - {
|
| - WEBRTC_TRACE(kTraceError, kTraceFile, _id,"buffer NULL");
|
| + if (buffer == nullptr) {
|
| + WEBRTC_TRACE(kTraceError, kTraceFile, _id, "buffer null");
|
| }
|
|
|
| size_t bytesWritten = 0;
|
| @@ -1119,9 +1111,8 @@ int32_t ModuleFileUtility::WriteCompressedData(
|
| "ModuleFileUtility::WriteCompressedData(out= 0x%x, buf= 0x%x, "
|
| "dataLen= %" PRIuS ")", &out, buffer, dataLength);
|
|
|
| - if(buffer == NULL)
|
| - {
|
| - WEBRTC_TRACE(kTraceError, kTraceFile, _id,"buffer NULL");
|
| + if (buffer == nullptr) {
|
| + WEBRTC_TRACE(kTraceError, kTraceFile, _id, "buffer null");
|
| }
|
|
|
| if(!out.Write(buffer, dataLength))
|
| @@ -1205,9 +1196,8 @@ int32_t ModuleFileUtility::ReadPCMData(InStream& pcm,
|
| "ModuleFileUtility::ReadPCMData(pcm= 0x%x, outData= 0x%x, "
|
| "bufSize= %" PRIuS ")", &pcm, outData, bufferSize);
|
|
|
| - if(outData == NULL)
|
| - {
|
| - WEBRTC_TRACE(kTraceError, kTraceFile, _id, "buffer NULL");
|
| + if (outData == nullptr) {
|
| + WEBRTC_TRACE(kTraceError, kTraceFile, _id, "buffer null");
|
| }
|
|
|
| // Readsize for 10ms of audio data (2 bytes per sample).
|
| @@ -1334,9 +1324,8 @@ int32_t ModuleFileUtility::WritePCMData(OutStream& out,
|
| "ModuleFileUtility::WritePCMData(out= 0x%x, buf= 0x%x, "
|
| "dataLen= %" PRIuS ")", &out, buffer, dataLength);
|
|
|
| - if(buffer == NULL)
|
| - {
|
| - WEBRTC_TRACE(kTraceError, kTraceFile, _id, "buffer NULL");
|
| + if (buffer == nullptr) {
|
| + WEBRTC_TRACE(kTraceError, kTraceFile, _id, "buffer null");
|
| }
|
|
|
| if(!out.Write(buffer, dataLength))
|
| @@ -1434,11 +1423,9 @@ int32_t ModuleFileUtility::FileDurationMs(const char* fileName,
|
| const FileFormats fileFormat,
|
| const uint32_t freqInHz)
|
| {
|
| -
|
| - if(fileName == NULL)
|
| - {
|
| - WEBRTC_TRACE(kTraceError, kTraceFile, _id, "filename NULL");
|
| - return -1;
|
| + if (fileName == nullptr) {
|
| + WEBRTC_TRACE(kTraceError, kTraceFile, _id, "filename null");
|
| + return -1;
|
| }
|
|
|
| int32_t time_in_ms = -1;
|
| @@ -1450,11 +1437,10 @@ int32_t ModuleFileUtility::FileDurationMs(const char* fileName,
|
| return -1;
|
| }
|
| FileWrapper* inStreamObj = FileWrapper::Create();
|
| - if(inStreamObj == NULL)
|
| - {
|
| - WEBRTC_TRACE(kTraceMemory, kTraceFile, _id,
|
| - "failed to create InStream object!");
|
| - return -1;
|
| + if (inStreamObj == nullptr) {
|
| + WEBRTC_TRACE(kTraceMemory, kTraceFile, _id,
|
| + "failed to create InStream object!");
|
| + return -1;
|
| }
|
| if (!inStreamObj->OpenFile(fileName, true)) {
|
| delete inStreamObj;
|
|
|