Commit 15f6d173 authored by Guillaume Roguez's avatar Guillaume Roguez

media: fix wrong framerate emulation timing

A regression introduced by commit 88405c00 causes
framerate emulation not using the correct timing.
milliseconds was wrongly used in place of microseconds.
This patch changes this fact.

Change-Id: I29453582ce4f0a8f34838caea4a2ee9be5592dbe
Tuleap: #914
parent ed58b69e
......@@ -327,7 +327,7 @@ MediaDecoder::decode(VideoFrame& result)
auto target = startTime_ + static_cast<std::int64_t>(frame_time.real() * 1e6);
auto now = av_gettime();
if (target > now) {
std::this_thread::sleep_for(std::chrono::milliseconds(target - now));
std::this_thread::sleep_for(std::chrono::microseconds(target - now));
}
}
return Status::FrameFinished;
......@@ -378,7 +378,7 @@ MediaDecoder::decode(const AudioFrame& decodedFrame)
auto target = startTime_ + static_cast<std::int64_t>(frame_time.real() * 1e6);
auto now = av_gettime();
if (target > now) {
std::this_thread::sleep_for(std::chrono::milliseconds(target - now));
std::this_thread::sleep_for(std::chrono::microseconds(target - now));
}
}
return Status::FrameFinished;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment