fix timing issue when -nohold switches to new client fixes #481

This commit is contained in:
F. Duncanh
2025-12-13 12:30:20 -05:00
parent 28ef6b5980
commit 060a0abc00
6 changed files with 30 additions and 12 deletions

View File

@@ -356,7 +356,7 @@ http_handler_playback_info(raop_conn_t *conn, http_request_t *request, http_resp
logger_log(conn->raop->logger, LOGGER_DEBUG, "playback_info not available (finishing)");
//httpd_remove_known_connections(conn->raop->httpd);
http_response_set_disconnect(response,1);
conn->raop->callbacks.video_reset(conn->raop->callbacks.cls, true);
conn->raop->callbacks.video_reset(conn->raop->callbacks.cls, true, false);
return;
} else if (playback_info.position == -1.0) {
logger_log(conn->raop->logger, LOGGER_DEBUG, "playback_info not available");

View File

@@ -244,11 +244,11 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response) {
char ipaddr[40] = { '\0' };
utils_ipaddress_to_string(conn->remotelen, conn->remote, conn->zone_id, ipaddr, (int) (sizeof(ipaddr)));
if (httpd_nohold(conn->raop->httpd)) {
logger_log(conn->raop->logger, LOGGER_INFO, "\"nohold\" feature: switch to new connection request from %s", ipaddr);
if (conn->raop->callbacks.video_reset) {
conn->raop->callbacks.video_reset(conn->raop->callbacks.cls, false);
}
logger_log(conn->raop->logger, LOGGER_INFO, "*****\"nohold\" feature: switch to new connection request from %s", ipaddr);
httpd_remove_known_connections(conn->raop->httpd);
if (conn->raop->callbacks.video_reset) {
conn->raop->callbacks.video_reset(conn->raop->callbacks.cls, false, true);
}
} else {
logger_log(conn->raop->logger, LOGGER_WARNING, "rejecting new connection request from %s", ipaddr);
*response = http_response_create();

View File

@@ -67,7 +67,7 @@ struct raop_callbacks_s {
void (*video_resume)(void *cls);
void (*conn_feedback) (void *cls);
void (*conn_reset) (void *cls, int reason);
void (*video_reset) (void *cls, bool hls_shutdown);
void (*video_reset) (void *cls, bool hls_shutdown, bool nohold);
/* Optional but recommended callback functions (probably not optional, check this)*/

View File

@@ -1265,7 +1265,7 @@ raop_handler_teardown(raop_conn_t *conn,
}
}
} else if (teardown_110) {
conn->raop->callbacks.video_reset(conn->raop->callbacks.cls, false);
conn->raop->callbacks.video_reset(conn->raop->callbacks.cls, false, false);
if (conn->raop_rtp_mirror) {
/* Stop our video RTP session */
raop_rtp_mirror_stop(conn->raop_rtp_mirror);
@@ -1283,7 +1283,7 @@ raop_handler_teardown(raop_conn_t *conn,
/* shut down any HLS connections */
int hls_count = httpd_count_connection_type(conn->raop->httpd, CONNECTION_TYPE_HLS);
if (hls_count) {
conn->raop->callbacks.video_reset(conn->raop->callbacks.cls, true);
conn->raop->callbacks.video_reset(conn->raop->callbacks.cls, true, false);
}
}
if (conn->raop->callbacks.conn_teardown) {

View File

@@ -852,7 +852,7 @@ raop_rtp_mirror_thread(void *arg)
if (unsupported_codec) {
closesocket(raop_rtp_mirror->mirror_data_sock);
raop_rtp_mirror_stop(raop_rtp_mirror);
raop_rtp_mirror->callbacks.video_reset(raop_rtp_mirror->callbacks.cls, false);
raop_rtp_mirror->callbacks.video_reset(raop_rtp_mirror->callbacks.cls, false, false);
}
return 0;