remove unused function

This commit is contained in:
badaix 2019-11-17 15:57:07 +01:00
parent ba2e40909e
commit cdc5dd2bac
3 changed files with 10 additions and 13 deletions

View file

@ -50,6 +50,7 @@ public:
~PcmChunk() override = default;
#if 0
template <class Rep, class Period>
int readFrames(void* outputBuffer, const std::chrono::duration<Rep, Period>& duration)
{
@ -58,6 +59,7 @@ public:
// return readFrames(outputBuffer, (us * 48000) / std::micro::den);
return frames;
}
#endif
int readFrames(void* outputBuffer, size_t frameCount)
{

View file

@ -258,10 +258,10 @@ int main(int argc, char* argv[])
settings.stream.streamReadMs = 10;
}
if (settings.stream.bufferMs < 100)
if (settings.stream.bufferMs < 400)
{
LOG(WARNING) << "Buffer is less than 100ms, changing to 100ms\n";
settings.stream.bufferMs = 100;
LOG(WARNING) << "Buffer is less than 400ms, changing to 400ms\n";
settings.stream.bufferMs = 400;
}
boost::asio::io_context io_context;

View file

@ -98,20 +98,15 @@ PcmStreamPtr StreamManager::addStream(const std::string& uri)
void StreamManager::removeStream(const std::string& name)
{
if (streams_.empty())
return;
for (std::vector<PcmStreamPtr>::iterator iter = streams_.begin(); iter != streams_.end(); ++iter)
auto iter = std::find_if(streams_.begin(), streams_.end(), [&name](const PcmStreamPtr& stream) { return stream->getName() == name; });
if (iter != streams_.end())
{
auto s = *iter;
if (s->getName() == name)
{
s->stop();
streams_.erase(iter);
break;
}
(*iter)->stop();
streams_.erase(iter);
}
}
const std::vector<PcmStreamPtr>& StreamManager::getStreams()
{
return streams_;