mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-14 17:46:45 +02:00
adjusted log tags
This commit is contained in:
parent
2872527e0b
commit
750df78090
6 changed files with 10 additions and 10 deletions
|
@ -208,7 +208,7 @@ SampleFormat OggDecoder::setHeader(msg::Header* chunk)
|
||||||
++ptr;
|
++ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
logE << "Encoded by: " << vc.vendor << "\n";
|
logO << "Encoded by: " << vc.vendor << "\n";
|
||||||
|
|
||||||
/// OK, got and parsed all three headers. Initialize the Vorbis packet->PCM decoder.
|
/// OK, got and parsed all three headers. Initialize the Vorbis packet->PCM decoder.
|
||||||
if (vorbis_synthesis_init(&vd, &vi) == 0)
|
if (vorbis_synthesis_init(&vd, &vi) == 0)
|
||||||
|
|
|
@ -316,7 +316,7 @@ void OpenslPlayer::uninitOpensl()
|
||||||
// if (!active_)
|
// if (!active_)
|
||||||
// return;
|
// return;
|
||||||
|
|
||||||
logE << "uninitOpensl\n";
|
logO << "uninitOpensl\n";
|
||||||
SLresult result;
|
SLresult result;
|
||||||
logO << "OpenSLWrap_Shutdown - stopping playback\n";
|
logO << "OpenSLWrap_Shutdown - stopping playback\n";
|
||||||
if (bqPlayerPlay != NULL)
|
if (bqPlayerPlay != NULL)
|
||||||
|
|
|
@ -91,14 +91,14 @@ void StreamServer::onDisconnect(StreamSession* streamSession)
|
||||||
|
|
||||||
logO << "onDisconnect: " << session->macAddress << "\n";
|
logO << "onDisconnect: " << session->macAddress << "\n";
|
||||||
ClientInfoPtr clientInfo = Config::instance().getClientInfo(streamSession->macAddress);
|
ClientInfoPtr clientInfo = Config::instance().getClientInfo(streamSession->macAddress);
|
||||||
logE << "sessions: " << sessions_.size() << "\n";
|
logD << "sessions: " << sessions_.size() << "\n";
|
||||||
// don't block: remove StreamSession in a thread
|
// don't block: remove StreamSession in a thread
|
||||||
auto func = [](shared_ptr<StreamSession> s)->void{s->stop();};
|
auto func = [](shared_ptr<StreamSession> s)->void{s->stop();};
|
||||||
std::thread t(func, session);
|
std::thread t(func, session);
|
||||||
t.detach();
|
t.detach();
|
||||||
sessions_.erase(session);
|
sessions_.erase(session);
|
||||||
|
|
||||||
logE << "sessions: " << sessions_.size() << "\n";
|
logD << "sessions: " << sessions_.size() << "\n";
|
||||||
|
|
||||||
// notify controllers if not yet done
|
// notify controllers if not yet done
|
||||||
if (!clientInfo || !clientInfo->connected)
|
if (!clientInfo || !clientInfo->connected)
|
||||||
|
@ -371,7 +371,7 @@ void StreamServer::start()
|
||||||
streamManager_.reset(new StreamManager(this, settings_.sampleFormat, settings_.codec, settings_.streamReadMs));
|
streamManager_.reset(new StreamManager(this, settings_.sampleFormat, settings_.codec, settings_.streamReadMs));
|
||||||
//TODO: check uniqueness of the stream
|
//TODO: check uniqueness of the stream
|
||||||
for (auto& streamUri: settings_.pcmStreams)
|
for (auto& streamUri: settings_.pcmStreams)
|
||||||
logE << "Stream: " << streamManager_->addStream(streamUri)->getUri().toJson() << "\n";
|
logO << "Stream: " << streamManager_->addStream(streamUri)->getUri().toJson() << "\n";
|
||||||
// throw SnapException("bad");
|
// throw SnapException("bad");
|
||||||
|
|
||||||
streamManager_->start();
|
streamManager_->start();
|
||||||
|
|
|
@ -46,7 +46,7 @@ PcmStream::PcmStream(PcmListener* pcmListener, const StreamUri& uri) : pcmListen
|
||||||
if (uri_.query.find("sampleformat") == uri_.query.end())
|
if (uri_.query.find("sampleformat") == uri_.query.end())
|
||||||
throw SnapException("Stream URI must have a sampleformat");
|
throw SnapException("Stream URI must have a sampleformat");
|
||||||
sampleFormat_ = SampleFormat(uri_.query["sampleformat"]);
|
sampleFormat_ = SampleFormat(uri_.query["sampleformat"]);
|
||||||
logE << "PcmStream sampleFormat: " << sampleFormat_.getFormat() << "\n";
|
logO << "PcmStream sampleFormat: " << sampleFormat_.getFormat() << "\n";
|
||||||
|
|
||||||
if (uri_.query.find("buffer_ms") != uri_.query.end())
|
if (uri_.query.find("buffer_ms") != uri_.query.end())
|
||||||
pcmReadMs_ = cpt::stoul(uri_.query["buffer_ms"]);
|
pcmReadMs_ = cpt::stoul(uri_.query["buffer_ms"]);
|
||||||
|
@ -85,7 +85,7 @@ const SampleFormat& PcmStream::getSampleFormat() const
|
||||||
|
|
||||||
void PcmStream::start()
|
void PcmStream::start()
|
||||||
{
|
{
|
||||||
logE << "PcmStream start: " << sampleFormat_.getFormat() << "\n";
|
logD << "PcmStream start: " << sampleFormat_.getFormat() << "\n";
|
||||||
//TODO: wrong encoder settings leads to: terminate called after throwing an instance of 'std::system_error' what(): Invalid argument
|
//TODO: wrong encoder settings leads to: terminate called after throwing an instance of 'std::system_error' what(): Invalid argument
|
||||||
encoder_->init(this, sampleFormat_);
|
encoder_->init(this, sampleFormat_);
|
||||||
|
|
||||||
|
|
|
@ -45,11 +45,11 @@ PcmStream* StreamManager::addStream(const std::string& uri)
|
||||||
if (streamUri.query.find("buffer_ms") == streamUri.query.end())
|
if (streamUri.query.find("buffer_ms") == streamUri.query.end())
|
||||||
streamUri.query["buffer_ms"] = to_string(readBufferMs_);
|
streamUri.query["buffer_ms"] = to_string(readBufferMs_);
|
||||||
|
|
||||||
// logE << "\nURI: " << streamUri.uri << "\nscheme: " << streamUri.scheme << "\nhost: "
|
// logD << "\nURI: " << streamUri.uri << "\nscheme: " << streamUri.scheme << "\nhost: "
|
||||||
// << streamUri.host << "\npath: " << streamUri.path << "\nfragment: " << streamUri.fragment << "\n";
|
// << streamUri.host << "\npath: " << streamUri.path << "\nfragment: " << streamUri.fragment << "\n";
|
||||||
|
|
||||||
// for (auto kv: streamUri.query)
|
// for (auto kv: streamUri.query)
|
||||||
// logE << "key: '" << kv.first << "' value: '" << kv.second << "'\n";
|
// logD << "key: '" << kv.first << "' value: '" << kv.second << "'\n";
|
||||||
|
|
||||||
if (streamUri.scheme == "pipe")
|
if (streamUri.scheme == "pipe")
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,7 +31,7 @@ StreamUri::StreamUri(const std::string& streamUri)
|
||||||
// https://en.wikipedia.org/wiki/Uniform_Resource_Identifier
|
// https://en.wikipedia.org/wiki/Uniform_Resource_Identifier
|
||||||
// scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]
|
// scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]
|
||||||
// would be more elegant with regex. Not yet supported on my dev machine's gcc 4.8 :(
|
// would be more elegant with regex. Not yet supported on my dev machine's gcc 4.8 :(
|
||||||
logE << "StreamUri: " << streamUri << "\n";
|
logD << "StreamUri: " << streamUri << "\n";
|
||||||
size_t pos;
|
size_t pos;
|
||||||
uri = trim_copy(streamUri);
|
uri = trim_copy(streamUri);
|
||||||
while (!uri.empty() && ((uri[0] == '\'') || (uri[0] == '"')))
|
while (!uri.empty() && ((uri[0] == '\'') || (uri[0] == '"')))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue