Warn when the audio callback takes more than it should
This commit is contained in:
parent
352d03ed3f
commit
e31132face
1 changed files with 3 additions and 0 deletions
|
|
@ -89,6 +89,9 @@ namespace psemek::sdl2
|
|||
|
||||
for (auto s : self->buffer_)
|
||||
*dst++ = static_cast<std::int16_t>(std::max(std::min((65535.f * s - 1.f) / 2.f, 32767.f), -32768.f));
|
||||
|
||||
if (auto duration = prof.duration(); duration > (size * audio::inv_frequency / 2))
|
||||
log::warning() << "Audio can't keep up, callback took " << std::setprecision(5) << (1000.0 * duration) << " ms";
|
||||
}
|
||||
|
||||
audio::channel_ptr audio_engine_impl::output()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue