Skip to content
Snippets Groups Projects
Commit b636c521 authored by Hugo Lefeuvre's avatar Hugo Lefeuvre
Browse files

media_recorder: fix start time in startRecording


Whenever startRecording() is called and path_ is not empty (new API)
the start time variable is left uninitialized.

This commit addresses this issue.

Change-Id: I9020e91695c6803d881967999d868d4ba4fd1c72
Reviewed-by: default avatarPhilippe Gorley <philippe.gorley@savoirfairelinux.com>
parent 92f3e151
No related branches found
No related tags found
No related merge requests found
...@@ -144,10 +144,11 @@ MediaRecorder::toggleRecording() ...@@ -144,10 +144,11 @@ MediaRecorder::toggleRecording()
int int
MediaRecorder::startRecording() MediaRecorder::startRecording()
{ {
if (path_.empty()) {
// FIXME deprecated code, will be removed once all clients transitioned to startRecording(path).
std::time_t t = std::time(nullptr); std::time_t t = std::time(nullptr);
startTime_ = *std::localtime(&t); startTime_ = *std::localtime(&t);
if (path_.empty()) {
// FIXME deprecated code, will be removed once all clients transitioned to startRecording(path).
std::stringstream ss; std::stringstream ss;
ss << std::put_time(&startTime_, "%Y%m%d-%H%M%S"); ss << std::put_time(&startTime_, "%Y%m%d-%H%M%S");
filename_ = ss.str(); filename_ = ss.str();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment