Skip to content
Snippets Groups Projects
Commit 0b0d6a85 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

MediaRecorder: setup streams when recording start

Change-Id: Ifa4cab061b297226f48df1161e1e75745858c566
parent 13b55fc8
No related branches found
No related tags found
No related merge requests found
......@@ -201,12 +201,16 @@ MediaRecorder::startRecording()
std::lock_guard<std::mutex> lk(encoderMtx_);
encoder_.reset(new MediaEncoder);
JAMI_DBG() << "Start recording '" << getPath() << "'";
JAMI_LOG("Start recording '{}'", getPath());
if (initRecord() >= 0) {
isRecording_ = true;
{
std::lock_guard<std::mutex> lk(mutexStreamSetup_);
for (auto& media : streams_) {
if (media.second->info.isVideo)
setupVideoOutput();
else
setupAudioOutput();
media.second->isEnabled = true;
}
}
......@@ -303,11 +307,6 @@ MediaRecorder::addStream(const MediaStream& ms)
}
}
it->second->isEnabled = isRecording_;
if (ms.isVideo)
setupVideoOutput();
else
setupAudioOutput();
return it->second.get();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment