From 5eb0cbc887c2b68d8ccc1057b0da44aa69ccde9b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 5 Jul 2016 17:44:45 +0200 Subject: [PATCH] PlayerThread: make chunk allocation error non-fatal in SendSilence() Fixes abort after seeking on fast machines. --- NEWS | 1 + src/PlayerThread.cxx | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 43190a367..4ef12c30e 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,5 @@ ver 0.19.17 (not yet released) +* fix spurious seek error "Failed to allocate silence buffer" * replay gain: fix "replay_gain_handler mixer" setting ver 0.19.16 (2016/06/13) diff --git a/src/PlayerThread.cxx b/src/PlayerThread.cxx index 30e509b3b..a2bb528b0 100644 --- a/src/PlayerThread.cxx +++ b/src/PlayerThread.cxx @@ -486,8 +486,12 @@ Player::SendSilence() MusicChunk *chunk = buffer.Allocate(); if (chunk == nullptr) { - LogError(player_domain, "Failed to allocate silence buffer"); - return false; + /* this is non-fatal, because this means that the + decoder has filled to buffer completely meanwhile; + by ignoring the error, we work around this race + condition */ + LogDebug(player_domain, "Failed to allocate silence buffer"); + return true; } #ifndef NDEBUG