Commit 28e864e0 authored by Max Kellermann's avatar Max Kellermann

player/Thread: log message when decoder is too slow

parent 1de19b92
ver 0.20.12 (not yet released)
* input
- curl: fix seeking
* player
- log message when decoder is too slow
ver 0.20.11 (2017/10/18)
* storage
......
......@@ -32,6 +32,7 @@
#include "output/MultipleOutputs.hxx"
#include "tag/Tag.hxx"
#include "Idle.hxx"
#include "system/PeriodClock.hxx"
#include "util/Domain.hxx"
#include "thread/Name.hxx"
#include "Log.hxx"
......@@ -146,6 +147,8 @@ class Player {
*/
SongTime elapsed_time;
PeriodClock throttle_silence_log;
public:
Player(PlayerControl &_pc, DecoderControl &_dc,
MusicBuffer &_buffer)
......@@ -934,6 +937,8 @@ Player::SongBorder()
{
FormatDefault(player_domain, "played \"%s\"", song->GetURI());
throttle_silence_log.Reset();
ReplacePipe(dc.pipe);
pc.outputs.SongBorder();
......@@ -1095,6 +1100,10 @@ Player::Run()
/* the decoder is too busy and hasn't provided
new PCM data in time: send silence (if the
output pipe is empty) */
if (throttle_silence_log.CheckUpdate(std::chrono::seconds(5)))
FormatWarning(player_domain, "Decoder is too slow; playing silence to avoid xrun");
if (!SendSilence())
break;
}
......
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