Skip to content
Snippets Groups Projects
Commit 80074aad authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

media: change sleep from milli to micro seconds

Change-Id: I40319255b39c8ea37f8b94fc0756fd68add34700
parent e78daee3
Branches
Tags
No related merge requests found
...@@ -327,7 +327,7 @@ MediaDecoder::decode(VideoFrame& result) ...@@ -327,7 +327,7 @@ MediaDecoder::decode(VideoFrame& result)
auto target = startTime_ + static_cast<std::int64_t>(frame_time.real() * 1e6); auto target = startTime_ + static_cast<std::int64_t>(frame_time.real() * 1e6);
auto now = av_gettime(); auto now = av_gettime();
if (target > now) { 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; return Status::FrameFinished;
...@@ -378,7 +378,7 @@ MediaDecoder::decode(const AudioFrame& decodedFrame) ...@@ -378,7 +378,7 @@ MediaDecoder::decode(const AudioFrame& decodedFrame)
auto target = startTime_ + static_cast<std::int64_t>(frame_time.real() * 1e6); auto target = startTime_ + static_cast<std::int64_t>(frame_time.real() * 1e6);
auto now = av_gettime(); auto now = av_gettime();
if (target > now) { 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; return Status::FrameFinished;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment