| Index: webrtc/voice_engine/transmit_mixer.cc
 | 
| diff --git a/webrtc/voice_engine/transmit_mixer.cc b/webrtc/voice_engine/transmit_mixer.cc
 | 
| index be6297287b8bef28e06b654923f2d2c8be483669..ef446aa89269f3a29413a1b958427a98e72c3d1d 100644
 | 
| --- a/webrtc/voice_engine/transmit_mixer.cc
 | 
| +++ b/webrtc/voice_engine/transmit_mixer.cc
 | 
| @@ -182,9 +182,6 @@ TransmitMixer::TransmitMixer(uint32_t instanceId) :
 | 
|      audioproc_(NULL),
 | 
|      _voiceEngineObserverPtr(NULL),
 | 
|      _processThreadPtr(NULL),
 | 
| -    _filePlayerPtr(NULL),
 | 
| -    _fileRecorderPtr(NULL),
 | 
| -    _fileCallRecorderPtr(NULL),
 | 
|      // Avoid conflict with other channels by adding 1024 - 1026,
 | 
|      // won't use as much as 1024 channels.
 | 
|      _filePlayerId(instanceId + 1024),
 | 
| @@ -225,26 +222,17 @@ TransmitMixer::~TransmitMixer()
 | 
|      DeRegisterExternalMediaProcessing(kRecordingPreprocessing);
 | 
|      {
 | 
|          rtc::CritScope cs(&_critSect);
 | 
| -        if (_fileRecorderPtr)
 | 
| -        {
 | 
| -            _fileRecorderPtr->RegisterModuleFileCallback(NULL);
 | 
| -            _fileRecorderPtr->StopRecording();
 | 
| -            FileRecorder::DestroyFileRecorder(_fileRecorderPtr);
 | 
| -            _fileRecorderPtr = NULL;
 | 
| +        if (file_recorder_) {
 | 
| +          file_recorder_->RegisterModuleFileCallback(NULL);
 | 
| +          file_recorder_->StopRecording();
 | 
|          }
 | 
| -        if (_fileCallRecorderPtr)
 | 
| -        {
 | 
| -            _fileCallRecorderPtr->RegisterModuleFileCallback(NULL);
 | 
| -            _fileCallRecorderPtr->StopRecording();
 | 
| -            FileRecorder::DestroyFileRecorder(_fileCallRecorderPtr);
 | 
| -            _fileCallRecorderPtr = NULL;
 | 
| +        if (file_call_recorder_) {
 | 
| +          file_call_recorder_->RegisterModuleFileCallback(NULL);
 | 
| +          file_call_recorder_->StopRecording();
 | 
|          }
 | 
| -        if (_filePlayerPtr)
 | 
| -        {
 | 
| -            _filePlayerPtr->RegisterModuleFileCallback(NULL);
 | 
| -            _filePlayerPtr->StopPlayingFile();
 | 
| -            FilePlayer::DestroyFilePlayer(_filePlayerPtr);
 | 
| -            _filePlayerPtr = NULL;
 | 
| +        if (file_player_) {
 | 
| +          file_player_->RegisterModuleFileCallback(NULL);
 | 
| +          file_player_->StopPlayingFile();
 | 
|          }
 | 
|      }
 | 
|  }
 | 
| @@ -496,47 +484,36 @@ int TransmitMixer::StartPlayingFileAsMicrophone(const char* fileName,
 | 
|      rtc::CritScope cs(&_critSect);
 | 
|  
 | 
|      // Destroy the old instance
 | 
| -    if (_filePlayerPtr)
 | 
| -    {
 | 
| -        _filePlayerPtr->RegisterModuleFileCallback(NULL);
 | 
| -        FilePlayer::DestroyFilePlayer(_filePlayerPtr);
 | 
| -        _filePlayerPtr = NULL;
 | 
| +    if (file_player_) {
 | 
| +      file_player_->RegisterModuleFileCallback(NULL);
 | 
| +      file_player_.reset();
 | 
|      }
 | 
|  
 | 
|      // Dynamically create the instance
 | 
| -    _filePlayerPtr
 | 
| -        = FilePlayer::CreateFilePlayer(_filePlayerId,
 | 
| -                                       (const FileFormats) format);
 | 
| +    file_player_ =
 | 
| +        FilePlayer::NewFilePlayer(_filePlayerId, (const FileFormats)format);
 | 
|  
 | 
| -    if (_filePlayerPtr == NULL)
 | 
| -    {
 | 
| -        _engineStatisticsPtr->SetLastError(
 | 
| -            VE_INVALID_ARGUMENT, kTraceError,
 | 
| -            "StartPlayingFileAsMicrophone() filePlayer format isnot correct");
 | 
| -        return -1;
 | 
| +    if (!file_player_) {
 | 
| +      _engineStatisticsPtr->SetLastError(
 | 
| +          VE_INVALID_ARGUMENT, kTraceError,
 | 
| +          "StartPlayingFileAsMicrophone() filePlayer format isnot correct");
 | 
| +      return -1;
 | 
|      }
 | 
|  
 | 
|      const uint32_t notificationTime(0);
 | 
|  
 | 
| -    if (_filePlayerPtr->StartPlayingFile(
 | 
| -        fileName,
 | 
| -        loop,
 | 
| -        startPosition,
 | 
| -        volumeScaling,
 | 
| -        notificationTime,
 | 
| -        stopPosition,
 | 
| -        (const CodecInst*) codecInst) != 0)
 | 
| -    {
 | 
| -        _engineStatisticsPtr->SetLastError(
 | 
| -            VE_BAD_FILE, kTraceError,
 | 
| -            "StartPlayingFile() failed to start file playout");
 | 
| -        _filePlayerPtr->StopPlayingFile();
 | 
| -        FilePlayer::DestroyFilePlayer(_filePlayerPtr);
 | 
| -        _filePlayerPtr = NULL;
 | 
| -        return -1;
 | 
| +    if (file_player_->StartPlayingFile(
 | 
| +            fileName, loop, startPosition, volumeScaling, notificationTime,
 | 
| +            stopPosition, (const CodecInst*)codecInst) != 0) {
 | 
| +      _engineStatisticsPtr->SetLastError(
 | 
| +          VE_BAD_FILE, kTraceError,
 | 
| +          "StartPlayingFile() failed to start file playout");
 | 
| +      file_player_->StopPlayingFile();
 | 
| +      file_player_.reset();
 | 
| +      return -1;
 | 
|      }
 | 
|  
 | 
| -    _filePlayerPtr->RegisterModuleFileCallback(this);
 | 
| +    file_player_->RegisterModuleFileCallback(this);
 | 
|      _filePlaying = true;
 | 
|  
 | 
|      return 0;
 | 
| @@ -573,45 +550,35 @@ int TransmitMixer::StartPlayingFileAsMicrophone(InStream* stream,
 | 
|      rtc::CritScope cs(&_critSect);
 | 
|  
 | 
|      // Destroy the old instance
 | 
| -    if (_filePlayerPtr)
 | 
| -    {
 | 
| -        _filePlayerPtr->RegisterModuleFileCallback(NULL);
 | 
| -        FilePlayer::DestroyFilePlayer(_filePlayerPtr);
 | 
| -        _filePlayerPtr = NULL;
 | 
| +    if (file_player_) {
 | 
| +      file_player_->RegisterModuleFileCallback(NULL);
 | 
| +      file_player_.reset();
 | 
|      }
 | 
|  
 | 
|      // Dynamically create the instance
 | 
| -    _filePlayerPtr
 | 
| -        = FilePlayer::CreateFilePlayer(_filePlayerId,
 | 
| -                                       (const FileFormats) format);
 | 
| +    file_player_ =
 | 
| +        FilePlayer::NewFilePlayer(_filePlayerId, (const FileFormats)format);
 | 
|  
 | 
| -    if (_filePlayerPtr == NULL)
 | 
| -    {
 | 
| -        _engineStatisticsPtr->SetLastError(
 | 
| -            VE_INVALID_ARGUMENT, kTraceWarning,
 | 
| -            "StartPlayingFileAsMicrophone() filePlayer format isnot correct");
 | 
| -        return -1;
 | 
| +    if (!file_player_) {
 | 
| +      _engineStatisticsPtr->SetLastError(
 | 
| +          VE_INVALID_ARGUMENT, kTraceWarning,
 | 
| +          "StartPlayingFileAsMicrophone() filePlayer format isnot correct");
 | 
| +      return -1;
 | 
|      }
 | 
|  
 | 
|      const uint32_t notificationTime(0);
 | 
|  
 | 
| -    if (_filePlayerPtr->StartPlayingFile(
 | 
| -        (InStream&) *stream,
 | 
| -        startPosition,
 | 
| -        volumeScaling,
 | 
| -        notificationTime,
 | 
| -        stopPosition,
 | 
| -        (const CodecInst*) codecInst) != 0)
 | 
| -    {
 | 
| -        _engineStatisticsPtr->SetLastError(
 | 
| -            VE_BAD_FILE, kTraceError,
 | 
| -            "StartPlayingFile() failed to start file playout");
 | 
| -        _filePlayerPtr->StopPlayingFile();
 | 
| -        FilePlayer::DestroyFilePlayer(_filePlayerPtr);
 | 
| -        _filePlayerPtr = NULL;
 | 
| -        return -1;
 | 
| -    }
 | 
| -    _filePlayerPtr->RegisterModuleFileCallback(this);
 | 
| +    if (file_player_->StartPlayingFile(
 | 
| +            (InStream&)*stream, startPosition, volumeScaling, notificationTime,
 | 
| +            stopPosition, (const CodecInst*)codecInst) != 0) {
 | 
| +      _engineStatisticsPtr->SetLastError(
 | 
| +          VE_BAD_FILE, kTraceError,
 | 
| +          "StartPlayingFile() failed to start file playout");
 | 
| +      file_player_->StopPlayingFile();
 | 
| +      file_player_.reset();
 | 
| +      return -1;
 | 
| +    }
 | 
| +    file_player_->RegisterModuleFileCallback(this);
 | 
|      _filePlaying = true;
 | 
|  
 | 
|      return 0;
 | 
| @@ -629,17 +596,15 @@ int TransmitMixer::StopPlayingFileAsMicrophone()
 | 
|  
 | 
|      rtc::CritScope cs(&_critSect);
 | 
|  
 | 
| -    if (_filePlayerPtr->StopPlayingFile() != 0)
 | 
| -    {
 | 
| -        _engineStatisticsPtr->SetLastError(
 | 
| -            VE_CANNOT_STOP_PLAYOUT, kTraceError,
 | 
| -            "StopPlayingFile() couldnot stop playing file");
 | 
| -        return -1;
 | 
| +    if (file_player_->StopPlayingFile() != 0) {
 | 
| +      _engineStatisticsPtr->SetLastError(
 | 
| +          VE_CANNOT_STOP_PLAYOUT, kTraceError,
 | 
| +          "StopPlayingFile() couldnot stop playing file");
 | 
| +      return -1;
 | 
|      }
 | 
|  
 | 
| -    _filePlayerPtr->RegisterModuleFileCallback(NULL);
 | 
| -    FilePlayer::DestroyFilePlayer(_filePlayerPtr);
 | 
| -    _filePlayerPtr = NULL;
 | 
| +    file_player_->RegisterModuleFileCallback(NULL);
 | 
| +    file_player_.reset();
 | 
|      _filePlaying = false;
 | 
|  
 | 
|      return 0;
 | 
| @@ -694,38 +659,30 @@ int TransmitMixer::StartRecordingMicrophone(const char* fileName,
 | 
|      }
 | 
|  
 | 
|      // Destroy the old instance
 | 
| -    if (_fileRecorderPtr)
 | 
| -    {
 | 
| -        _fileRecorderPtr->RegisterModuleFileCallback(NULL);
 | 
| -        FileRecorder::DestroyFileRecorder(_fileRecorderPtr);
 | 
| -        _fileRecorderPtr = NULL;
 | 
| -    }
 | 
| -
 | 
| -    _fileRecorderPtr =
 | 
| -        FileRecorder::CreateFileRecorder(_fileRecorderId,
 | 
| -                                         (const FileFormats) format);
 | 
| -    if (_fileRecorderPtr == NULL)
 | 
| -    {
 | 
| -        _engineStatisticsPtr->SetLastError(
 | 
| -            VE_INVALID_ARGUMENT, kTraceError,
 | 
| -            "StartRecordingMicrophone() fileRecorder format isnot correct");
 | 
| -        return -1;
 | 
| -    }
 | 
| -
 | 
| -    if (_fileRecorderPtr->StartRecordingAudioFile(
 | 
| -        fileName,
 | 
| -        (const CodecInst&) *codecInst,
 | 
| -        notificationTime) != 0)
 | 
| -    {
 | 
| -        _engineStatisticsPtr->SetLastError(
 | 
| -            VE_BAD_FILE, kTraceError,
 | 
| -            "StartRecordingAudioFile() failed to start file recording");
 | 
| -        _fileRecorderPtr->StopRecording();
 | 
| -        FileRecorder::DestroyFileRecorder(_fileRecorderPtr);
 | 
| -        _fileRecorderPtr = NULL;
 | 
| -        return -1;
 | 
| -    }
 | 
| -    _fileRecorderPtr->RegisterModuleFileCallback(this);
 | 
| +    if (file_recorder_) {
 | 
| +      file_recorder_->RegisterModuleFileCallback(NULL);
 | 
| +      file_recorder_.reset();
 | 
| +    }
 | 
| +
 | 
| +    file_recorder_ = FileRecorder::CreateFileRecorder(
 | 
| +        _fileRecorderId, (const FileFormats)format);
 | 
| +    if (!file_recorder_) {
 | 
| +      _engineStatisticsPtr->SetLastError(
 | 
| +          VE_INVALID_ARGUMENT, kTraceError,
 | 
| +          "StartRecordingMicrophone() fileRecorder format isnot correct");
 | 
| +      return -1;
 | 
| +    }
 | 
| +
 | 
| +    if (file_recorder_->StartRecordingAudioFile(
 | 
| +            fileName, (const CodecInst&)*codecInst, notificationTime) != 0) {
 | 
| +      _engineStatisticsPtr->SetLastError(
 | 
| +          VE_BAD_FILE, kTraceError,
 | 
| +          "StartRecordingAudioFile() failed to start file recording");
 | 
| +      file_recorder_->StopRecording();
 | 
| +      file_recorder_.reset();
 | 
| +      return -1;
 | 
| +    }
 | 
| +    file_recorder_->RegisterModuleFileCallback(this);
 | 
|      _fileRecording = true;
 | 
|  
 | 
|      return 0;
 | 
| @@ -772,37 +729,31 @@ int TransmitMixer::StartRecordingMicrophone(OutStream* stream,
 | 
|      }
 | 
|  
 | 
|      // Destroy the old instance
 | 
| -    if (_fileRecorderPtr)
 | 
| -    {
 | 
| -        _fileRecorderPtr->RegisterModuleFileCallback(NULL);
 | 
| -        FileRecorder::DestroyFileRecorder(_fileRecorderPtr);
 | 
| -        _fileRecorderPtr = NULL;
 | 
| +    if (file_recorder_) {
 | 
| +      file_recorder_->RegisterModuleFileCallback(NULL);
 | 
| +      file_recorder_.reset();
 | 
|      }
 | 
|  
 | 
| -    _fileRecorderPtr =
 | 
| -        FileRecorder::CreateFileRecorder(_fileRecorderId,
 | 
| -                                         (const FileFormats) format);
 | 
| -    if (_fileRecorderPtr == NULL)
 | 
| -    {
 | 
| -        _engineStatisticsPtr->SetLastError(
 | 
| -            VE_INVALID_ARGUMENT, kTraceError,
 | 
| -            "StartRecordingMicrophone() fileRecorder format isnot correct");
 | 
| -        return -1;
 | 
| +    file_recorder_ = FileRecorder::CreateFileRecorder(
 | 
| +        _fileRecorderId, (const FileFormats)format);
 | 
| +    if (!file_recorder_) {
 | 
| +      _engineStatisticsPtr->SetLastError(
 | 
| +          VE_INVALID_ARGUMENT, kTraceError,
 | 
| +          "StartRecordingMicrophone() fileRecorder format isnot correct");
 | 
| +      return -1;
 | 
|      }
 | 
|  
 | 
| -    if (_fileRecorderPtr->StartRecordingAudioFile(*stream,
 | 
| -                                                  *codecInst,
 | 
| -                                                  notificationTime) != 0)
 | 
| -    {
 | 
| -    _engineStatisticsPtr->SetLastError(VE_BAD_FILE, kTraceError,
 | 
| -      "StartRecordingAudioFile() failed to start file recording");
 | 
| -    _fileRecorderPtr->StopRecording();
 | 
| -    FileRecorder::DestroyFileRecorder(_fileRecorderPtr);
 | 
| -    _fileRecorderPtr = NULL;
 | 
| -    return -1;
 | 
| +    if (file_recorder_->StartRecordingAudioFile(*stream, *codecInst,
 | 
| +                                                notificationTime) != 0) {
 | 
| +      _engineStatisticsPtr->SetLastError(
 | 
| +          VE_BAD_FILE, kTraceError,
 | 
| +          "StartRecordingAudioFile() failed to start file recording");
 | 
| +      file_recorder_->StopRecording();
 | 
| +      file_recorder_.reset();
 | 
| +      return -1;
 | 
|      }
 | 
|  
 | 
| -    _fileRecorderPtr->RegisterModuleFileCallback(this);
 | 
| +    file_recorder_->RegisterModuleFileCallback(this);
 | 
|      _fileRecording = true;
 | 
|  
 | 
|      return 0;
 | 
| @@ -823,16 +774,14 @@ int TransmitMixer::StopRecordingMicrophone()
 | 
|          return 0;
 | 
|      }
 | 
|  
 | 
| -    if (_fileRecorderPtr->StopRecording() != 0)
 | 
| -    {
 | 
| -        _engineStatisticsPtr->SetLastError(
 | 
| -            VE_STOP_RECORDING_FAILED, kTraceError,
 | 
| -            "StopRecording(), could not stop recording");
 | 
| -        return -1;
 | 
| +    if (file_recorder_->StopRecording() != 0) {
 | 
| +      _engineStatisticsPtr->SetLastError(
 | 
| +          VE_STOP_RECORDING_FAILED, kTraceError,
 | 
| +          "StopRecording(), could not stop recording");
 | 
| +      return -1;
 | 
|      }
 | 
| -    _fileRecorderPtr->RegisterModuleFileCallback(NULL);
 | 
| -    FileRecorder::DestroyFileRecorder(_fileRecorderPtr);
 | 
| -    _fileRecorderPtr = NULL;
 | 
| +    file_recorder_->RegisterModuleFileCallback(NULL);
 | 
| +    file_recorder_.reset();
 | 
|      _fileRecording = false;
 | 
|  
 | 
|      return 0;
 | 
| @@ -879,38 +828,30 @@ int TransmitMixer::StartRecordingCall(const char* fileName,
 | 
|      rtc::CritScope cs(&_critSect);
 | 
|  
 | 
|      // Destroy the old instance
 | 
| -    if (_fileCallRecorderPtr)
 | 
| -    {
 | 
| -        _fileCallRecorderPtr->RegisterModuleFileCallback(NULL);
 | 
| -        FileRecorder::DestroyFileRecorder(_fileCallRecorderPtr);
 | 
| -        _fileCallRecorderPtr = NULL;
 | 
| -    }
 | 
| -
 | 
| -    _fileCallRecorderPtr
 | 
| -        = FileRecorder::CreateFileRecorder(_fileCallRecorderId,
 | 
| -                                           (const FileFormats) format);
 | 
| -    if (_fileCallRecorderPtr == NULL)
 | 
| -    {
 | 
| -        _engineStatisticsPtr->SetLastError(
 | 
| -            VE_INVALID_ARGUMENT, kTraceError,
 | 
| -            "StartRecordingCall() fileRecorder format isnot correct");
 | 
| -        return -1;
 | 
| -    }
 | 
| -
 | 
| -    if (_fileCallRecorderPtr->StartRecordingAudioFile(
 | 
| -        fileName,
 | 
| -        (const CodecInst&) *codecInst,
 | 
| -        notificationTime) != 0)
 | 
| -    {
 | 
| -        _engineStatisticsPtr->SetLastError(
 | 
| -            VE_BAD_FILE, kTraceError,
 | 
| -            "StartRecordingAudioFile() failed to start file recording");
 | 
| -        _fileCallRecorderPtr->StopRecording();
 | 
| -        FileRecorder::DestroyFileRecorder(_fileCallRecorderPtr);
 | 
| -        _fileCallRecorderPtr = NULL;
 | 
| -        return -1;
 | 
| -    }
 | 
| -    _fileCallRecorderPtr->RegisterModuleFileCallback(this);
 | 
| +    if (file_call_recorder_) {
 | 
| +      file_call_recorder_->RegisterModuleFileCallback(NULL);
 | 
| +      file_call_recorder_.reset();
 | 
| +    }
 | 
| +
 | 
| +    file_call_recorder_ = FileRecorder::CreateFileRecorder(
 | 
| +        _fileCallRecorderId, (const FileFormats)format);
 | 
| +    if (!file_call_recorder_) {
 | 
| +      _engineStatisticsPtr->SetLastError(
 | 
| +          VE_INVALID_ARGUMENT, kTraceError,
 | 
| +          "StartRecordingCall() fileRecorder format isnot correct");
 | 
| +      return -1;
 | 
| +    }
 | 
| +
 | 
| +    if (file_call_recorder_->StartRecordingAudioFile(
 | 
| +            fileName, (const CodecInst&)*codecInst, notificationTime) != 0) {
 | 
| +      _engineStatisticsPtr->SetLastError(
 | 
| +          VE_BAD_FILE, kTraceError,
 | 
| +          "StartRecordingAudioFile() failed to start file recording");
 | 
| +      file_call_recorder_->StopRecording();
 | 
| +      file_call_recorder_.reset();
 | 
| +      return -1;
 | 
| +    }
 | 
| +    file_call_recorder_->RegisterModuleFileCallback(this);
 | 
|      _fileCallRecording = true;
 | 
|  
 | 
|      return 0;
 | 
| @@ -957,37 +898,31 @@ int TransmitMixer::StartRecordingCall(OutStream* stream,
 | 
|      rtc::CritScope cs(&_critSect);
 | 
|  
 | 
|      // Destroy the old instance
 | 
| -    if (_fileCallRecorderPtr)
 | 
| -    {
 | 
| -        _fileCallRecorderPtr->RegisterModuleFileCallback(NULL);
 | 
| -        FileRecorder::DestroyFileRecorder(_fileCallRecorderPtr);
 | 
| -        _fileCallRecorderPtr = NULL;
 | 
| +    if (file_call_recorder_) {
 | 
| +      file_call_recorder_->RegisterModuleFileCallback(NULL);
 | 
| +      file_call_recorder_.reset();
 | 
|      }
 | 
|  
 | 
| -    _fileCallRecorderPtr =
 | 
| -        FileRecorder::CreateFileRecorder(_fileCallRecorderId,
 | 
| -                                         (const FileFormats) format);
 | 
| -    if (_fileCallRecorderPtr == NULL)
 | 
| -    {
 | 
| -        _engineStatisticsPtr->SetLastError(
 | 
| -            VE_INVALID_ARGUMENT, kTraceError,
 | 
| -            "StartRecordingCall() fileRecorder format isnot correct");
 | 
| -        return -1;
 | 
| +    file_call_recorder_ = FileRecorder::CreateFileRecorder(
 | 
| +        _fileCallRecorderId, (const FileFormats)format);
 | 
| +    if (!file_call_recorder_) {
 | 
| +      _engineStatisticsPtr->SetLastError(
 | 
| +          VE_INVALID_ARGUMENT, kTraceError,
 | 
| +          "StartRecordingCall() fileRecorder format isnot correct");
 | 
| +      return -1;
 | 
|      }
 | 
|  
 | 
| -    if (_fileCallRecorderPtr->StartRecordingAudioFile(*stream,
 | 
| -                                                      *codecInst,
 | 
| -                                                      notificationTime) != 0)
 | 
| -    {
 | 
| -    _engineStatisticsPtr->SetLastError(VE_BAD_FILE, kTraceError,
 | 
| -     "StartRecordingAudioFile() failed to start file recording");
 | 
| -    _fileCallRecorderPtr->StopRecording();
 | 
| -    FileRecorder::DestroyFileRecorder(_fileCallRecorderPtr);
 | 
| -    _fileCallRecorderPtr = NULL;
 | 
| -    return -1;
 | 
| +    if (file_call_recorder_->StartRecordingAudioFile(*stream, *codecInst,
 | 
| +                                                     notificationTime) != 0) {
 | 
| +      _engineStatisticsPtr->SetLastError(
 | 
| +          VE_BAD_FILE, kTraceError,
 | 
| +          "StartRecordingAudioFile() failed to start file recording");
 | 
| +      file_call_recorder_->StopRecording();
 | 
| +      file_call_recorder_.reset();
 | 
| +      return -1;
 | 
|      }
 | 
|  
 | 
| -    _fileCallRecorderPtr->RegisterModuleFileCallback(this);
 | 
| +    file_call_recorder_->RegisterModuleFileCallback(this);
 | 
|      _fileCallRecording = true;
 | 
|  
 | 
|      return 0;
 | 
| @@ -1007,17 +942,15 @@ int TransmitMixer::StopRecordingCall()
 | 
|  
 | 
|      rtc::CritScope cs(&_critSect);
 | 
|  
 | 
| -    if (_fileCallRecorderPtr->StopRecording() != 0)
 | 
| -    {
 | 
| -        _engineStatisticsPtr->SetLastError(
 | 
| -            VE_STOP_RECORDING_FAILED, kTraceError,
 | 
| -            "StopRecording(), could not stop recording");
 | 
| -        return -1;
 | 
| +    if (file_call_recorder_->StopRecording() != 0) {
 | 
| +      _engineStatisticsPtr->SetLastError(
 | 
| +          VE_STOP_RECORDING_FAILED, kTraceError,
 | 
| +          "StopRecording(), could not stop recording");
 | 
| +      return -1;
 | 
|      }
 | 
|  
 | 
| -    _fileCallRecorderPtr->RegisterModuleFileCallback(NULL);
 | 
| -    FileRecorder::DestroyFileRecorder(_fileCallRecorderPtr);
 | 
| -    _fileCallRecorderPtr = NULL;
 | 
| +    file_call_recorder_->RegisterModuleFileCallback(NULL);
 | 
| +    file_call_recorder_.reset();
 | 
|      _fileCallRecording = false;
 | 
|  
 | 
|      return 0;
 | 
| @@ -1131,20 +1064,18 @@ int32_t TransmitMixer::RecordAudioToFile(
 | 
|      uint32_t mixingFrequency)
 | 
|  {
 | 
|      rtc::CritScope cs(&_critSect);
 | 
| -    if (_fileRecorderPtr == NULL)
 | 
| -    {
 | 
| -        WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1),
 | 
| -                     "TransmitMixer::RecordAudioToFile() filerecorder doesnot"
 | 
| -                     "exist");
 | 
| -        return -1;
 | 
| +    if (!file_recorder_) {
 | 
| +      WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1),
 | 
| +                   "TransmitMixer::RecordAudioToFile() filerecorder doesnot"
 | 
| +                   "exist");
 | 
| +      return -1;
 | 
|      }
 | 
|  
 | 
| -    if (_fileRecorderPtr->RecordAudioToFile(_audioFrame) != 0)
 | 
| -    {
 | 
| -        WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1),
 | 
| -                     "TransmitMixer::RecordAudioToFile() file recording"
 | 
| -                     "failed");
 | 
| -        return -1;
 | 
| +    if (file_recorder_->RecordAudioToFile(_audioFrame) != 0) {
 | 
| +      WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1),
 | 
| +                   "TransmitMixer::RecordAudioToFile() file recording"
 | 
| +                   "failed");
 | 
| +      return -1;
 | 
|      }
 | 
|  
 | 
|      return 0;
 | 
| @@ -1158,23 +1089,19 @@ int32_t TransmitMixer::MixOrReplaceAudioWithFile(
 | 
|      size_t fileSamples(0);
 | 
|      {
 | 
|          rtc::CritScope cs(&_critSect);
 | 
| -        if (_filePlayerPtr == NULL)
 | 
| -        {
 | 
| -            WEBRTC_TRACE(kTraceWarning, kTraceVoice,
 | 
| -                         VoEId(_instanceId, -1),
 | 
| -                         "TransmitMixer::MixOrReplaceAudioWithFile()"
 | 
| -                         "fileplayer doesnot exist");
 | 
| -            return -1;
 | 
| +        if (!file_player_) {
 | 
| +          WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1),
 | 
| +                       "TransmitMixer::MixOrReplaceAudioWithFile()"
 | 
| +                       "fileplayer doesnot exist");
 | 
| +          return -1;
 | 
|          }
 | 
|  
 | 
| -        if (_filePlayerPtr->Get10msAudioFromFile(fileBuffer.get(),
 | 
| -                                                 fileSamples,
 | 
| -                                                 mixingFrequency) == -1)
 | 
| -        {
 | 
| -            WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1),
 | 
| -                         "TransmitMixer::MixOrReplaceAudioWithFile() file"
 | 
| -                         " mixing failed");
 | 
| -            return -1;
 | 
| +        if (file_player_->Get10msAudioFromFile(fileBuffer.get(), fileSamples,
 | 
| +                                               mixingFrequency) == -1) {
 | 
| +          WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, -1),
 | 
| +                       "TransmitMixer::MixOrReplaceAudioWithFile() file"
 | 
| +                       " mixing failed");
 | 
| +          return -1;
 | 
|          }
 | 
|      }
 | 
|  
 | 
| 
 |