Reformat code

This commit is contained in:
badaix 2020-05-31 13:46:26 +02:00
parent c07b56816d
commit c1c521b260
2 changed files with 4 additions and 13 deletions

View file

@ -231,7 +231,6 @@ void WASAPIPlayer::worker()
CHECK_HR(hr);
// Get the control interface for the process-specific audio
// session with session GUID = GUID_NULL. This is the session
// that an audio stream for a DirectSound, DirectShow, waveOut,

View file

@ -232,18 +232,10 @@ void AirplayStream::pipeReadLine()
boost::asio::async_read_until(*pipe_fd_, streambuf_pipe_, delimiter, [this, delimiter](const std::error_code& ec, std::size_t bytes_transferred) {
if (ec)
{
if (ec.value() == boost::asio::error::eof)
if ((ec.value() == boost::asio::error::eof) || (ec.value() == boost::asio::error::bad_descriptor))
{
// For some reason, EOF is returned until the first metadata is written to the pipe.
// Is this a boost bug?
LOG(INFO, LOG_TAG) << "Waiting for metadata, retrying in 2500ms"
<< "\n";
wait(pipe_open_timer_, 2500ms, [this] { pipeReadLine(); });
}
if (ec.value() == boost::asio::error::bad_descriptor)
{
// If shairport-sync has not finished setting up the pipe, bad file descriptor is returned.
// retry in a few seconds
LOG(INFO, LOG_TAG) << "Waiting for metadata, retrying in 2500ms"
<< "\n";
wait(pipe_open_timer_, 2500ms, [this] { pipeReadLine(); });