player/Thread: log message when decoder is too slow
This commit is contained in:
parent
1de19b921a
commit
28e864e096
2
NEWS
2
NEWS
|
@ -1,6 +1,8 @@
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue