mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-03 03:11:43 +02:00
Add null sink to file player
This commit is contained in:
parent
8eb2fbc212
commit
1da7681570
2 changed files with 7 additions and 4 deletions
|
@ -47,7 +47,7 @@ FilePlayer::FilePlayer(boost::asio::io_context& io_context, const ClientSettings
|
|||
{
|
||||
file_.reset(stderr, [](auto p) { std::ignore = p; });
|
||||
}
|
||||
else
|
||||
else if (filename != "null")
|
||||
{
|
||||
std::string mode = "w";
|
||||
if (params.find("mode") != params.end())
|
||||
|
@ -91,8 +91,11 @@ void FilePlayer::requestAudio()
|
|||
{
|
||||
adjustVolume(static_cast<char*>(buffer_.data()), numFrames);
|
||||
}
|
||||
fwrite(buffer_.data(), 1, needed, file_.get());
|
||||
fflush(file_.get());
|
||||
if (file_)
|
||||
{
|
||||
fwrite(buffer_.data(), 1, needed, file_.get());
|
||||
fflush(file_.get());
|
||||
}
|
||||
loop();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue