gentoo-ebuilds/net-misc/sunshine/files/sunshine-boost-1.87.patch
James Le Cuirot 991083a7f1
net-misc/sunshine: Fix building against Boost 1.87
I think this will also work with 1.86 and 1.85. Let me know if it doesn't.

Closes: https://bugs.gentoo.org/946480
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
2024-12-28 23:26:23 +00:00

100 lines
3.3 KiB
Diff

diff --git a/src/rtsp.cpp b/src/rtsp.cpp
index 0180fbee..da20d134 100644
--- a/src/rtsp.cpp
+++ b/src/rtsp.cpp
@@ -90,8 +90,8 @@ namespace rtsp_stream {
class socket_t: public std::enable_shared_from_this<socket_t> {
public:
- socket_t(boost::asio::io_service &ios, std::function<void(tcp::socket &sock, launch_session_t &, msg_t &&)> &&handle_data_fn):
- handle_data_fn { std::move(handle_data_fn) }, sock { ios } {}
+ socket_t(boost::asio::io_context &io_context, std::function<void(tcp::socket &sock, launch_session_t &, msg_t &&)> &&handle_data_fn):
+ handle_data_fn { std::move(handle_data_fn) }, sock { io_context } {}
/**
* @brief Queues an asynchronous read to begin the next message.
@@ -440,7 +440,7 @@ namespace rtsp_stream {
return -1;
}
- next_socket = std::make_shared<socket_t>(ios, [this](tcp::socket &sock, launch_session_t &session, msg_t &&msg) {
+ next_socket = std::make_shared<socket_t>(io_context, [this](tcp::socket &sock, launch_session_t &session, msg_t &&msg) {
handle_msg(sock, session, std::move(msg));
});
@@ -454,7 +454,7 @@ namespace rtsp_stream {
template <class T, class X>
void
iterate(std::chrono::duration<T, X> timeout) {
- ios.run_one_for(timeout);
+ io_context.run_one_for(timeout);
}
void
@@ -499,7 +499,7 @@ namespace rtsp_stream {
}
// Queue another asynchronous accept for the next incoming connection
- next_socket = std::make_shared<socket_t>(ios, [this](tcp::socket &sock, launch_session_t &session, msg_t &&msg) {
+ next_socket = std::make_shared<socket_t>(io_context, [this](tcp::socket &sock, launch_session_t &session, msg_t &&msg) {
handle_msg(sock, session, std::move(msg));
});
acceptor.async_accept(next_socket->sock, [this](const auto &ec) {
@@ -591,8 +591,8 @@ namespace rtsp_stream {
}
}
- if (all && !ios.stopped()) {
- ios.stop();
+ if (all && !io_context.stopped()) {
+ io_context.stop();
}
}
@@ -627,8 +627,8 @@ namespace rtsp_stream {
std::chrono::steady_clock::time_point raised_timeout;
int _slot_count;
- boost::asio::io_service ios;
- tcp::acceptor acceptor { ios };
+ boost::asio::io_context io_context;
+ tcp::acceptor acceptor { io_context };
std::shared_ptr<socket_t> next_socket;
};
diff --git a/src/stream.cpp b/src/stream.cpp
index df5b3d96..0b304e23 100644
--- a/src/stream.cpp
+++ b/src/stream.cpp
@@ -340,10 +340,10 @@ namespace stream {
std::thread audio_thread;
std::thread control_thread;
- asio::io_service io;
+ asio::io_context io_context;
- udp::socket video_sock { io };
- udp::socket audio_sock { io };
+ udp::socket video_sock { io_context };
+ udp::socket audio_sock { io_context };
control_server_t control_server;
};
@@ -1159,7 +1159,7 @@ namespace stream {
auto &message_queue_queue = ctx.message_queue_queue;
auto broadcast_shutdown_event = mail::man->event<bool>(mail::broadcast_shutdown);
- auto &io = ctx.io;
+ auto &io = ctx.io_context;
udp::endpoint peer;
@@ -1664,7 +1664,7 @@ namespace stream {
audio_packets->stop();
ctx.message_queue_queue->stop();
- ctx.io.stop();
+ ctx.io_context.stop();
ctx.video_sock.close();
ctx.audio_sock.close();