mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-01 10:21:46 +02:00
Fix writing "PCM device not found" for file player
This commit is contained in:
parent
376ca7ff9e
commit
c88b2d170b
3 changed files with 22 additions and 2 deletions
|
@ -33,6 +33,19 @@ namespace player
|
|||
static constexpr auto LOG_TAG = "FilePlayer";
|
||||
static constexpr auto kDefaultBuffer = 50ms;
|
||||
|
||||
static constexpr auto kDescription = "Raw PCM file output";
|
||||
|
||||
std::vector<PcmDevice> FilePlayer::pcm_list(const std::string& parameter)
|
||||
{
|
||||
auto params = utils::string::split_pairs(parameter, ',', '=');
|
||||
string filename;
|
||||
if (params.find("filename") != params.end())
|
||||
filename = params["filename"];
|
||||
if (filename.empty())
|
||||
filename = "stdout";
|
||||
return {PcmDevice{0, filename, kDescription}};
|
||||
}
|
||||
|
||||
|
||||
FilePlayer::FilePlayer(boost::asio::io_context& io_context, const ClientSettings::Player& settings, std::shared_ptr<Stream> stream)
|
||||
: Player(io_context, settings, stream), timer_(io_context), file_(nullptr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue