mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-22 05:26:17 +02:00
Rename experimental.tcp to tcp
This commit is contained in:
parent
fd616956cb
commit
3cb9902bbe
4 changed files with 14 additions and 2 deletions
|
@ -82,8 +82,12 @@
|
|||
|
||||
# stream URI of the PCM input stream, can be configured multiple times
|
||||
# Format: TYPE://host/path?name=NAME[&codec=CODEC][&sampleformat=SAMPLEFORMAT]
|
||||
# Available types are:
|
||||
# pipe: pipe:///<path/to/pipe>?name=<name>
|
||||
# tcp server: tcp://<listen IP, e.g. 127.0.0.1>:<port>?name=<name>[&mode=server]
|
||||
# tcp client: tcp://<server IP, e.g. 127.0.0.1>:<port>?name=<name>&mode=client
|
||||
stream = pipe:///tmp/snapfifo?name=default
|
||||
#stream = experimental.tcp://127.0.0.1?name=mopidy_tcp
|
||||
#stream = tcp://127.0.0.1?name=mopidy_tcp
|
||||
|
||||
# Default sample format
|
||||
#sampleformat = 48000:16:2
|
||||
|
|
|
@ -96,6 +96,7 @@ template <typename ReadStream>
|
|||
void AsioStream<ReadStream>::start()
|
||||
{
|
||||
encoder_->init(this, sampleFormat_);
|
||||
active_ = true;
|
||||
check_state();
|
||||
connect();
|
||||
}
|
||||
|
@ -104,6 +105,7 @@ void AsioStream<ReadStream>::start()
|
|||
template <typename ReadStream>
|
||||
void AsioStream<ReadStream>::stop()
|
||||
{
|
||||
active_ = false;
|
||||
timer_.cancel();
|
||||
idle_timer_.cancel();
|
||||
disconnect();
|
||||
|
|
|
@ -79,7 +79,7 @@ PcmStreamPtr StreamManager::addStream(const std::string& uri)
|
|||
{
|
||||
stream = make_shared<AirplayStream>(pcmListener_, ioc_, streamUri);
|
||||
}
|
||||
else if (streamUri.scheme == "experimental.tcp")
|
||||
else if (streamUri.scheme == "tcp")
|
||||
{
|
||||
stream = make_shared<TcpStream>(pcmListener_, ioc_, streamUri);
|
||||
}
|
||||
|
|
|
@ -64,6 +64,9 @@ TcpStream::TcpStream(PcmListener* pcmListener, boost::asio::io_context& ioc, con
|
|||
|
||||
void TcpStream::connect()
|
||||
{
|
||||
if (!active_)
|
||||
return;
|
||||
|
||||
auto self = shared_from_this();
|
||||
|
||||
if (is_server_)
|
||||
|
@ -109,4 +112,7 @@ void TcpStream::disconnect()
|
|||
{
|
||||
if (stream_)
|
||||
stream_->close();
|
||||
if (acceptor_)
|
||||
acceptor_->cancel();
|
||||
reconnect_timer_.cancel();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue