Skip to content

Commit

Permalink
Fixed an issue of getting 0-bitrate during reconnect
Browse files Browse the repository at this point in the history
This issue was introduced by PR #5500 as it was not tested for reconnect.(Reconnect feature was broken when that PR was branched)
  • Loading branch information
Karthick Jeyapal authored and jkarthic committed Feb 11, 2022
1 parent c308348 commit 15b28ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions protocol/server/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Includes

#include <whist/core/whist.h>
#include <whist/network/network.h>
#include <whist/network/network_algorithm.h>
#include <whist/input/input.h>
#include <whist/logging/error_monitor.h>
#include <whist/utils/aes.h>
Expand Down Expand Up @@ -381,6 +382,13 @@ int multithreaded_manage_client(void *opaque) {

// When a new client has been connected, we want all threads to hold client active again
reset_threads_holding_active_count(&state->client);

// Fill the network settings with default value, if we have a valid width and height
if (state->client_width > 0 && state->client_height > 0) {
udp_handle_network_settings(
state->client.udp_context.context,
get_default_network_settings(state->client_width, state->client_height));
}
state->client.is_active = true;
}

Expand Down
2 changes: 1 addition & 1 deletion protocol/server/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ int32_t multithreaded_send_video(void* opaque) {
while (!state->exiting) {
update_client_active_status(&state->client, &assuming_client_active);

if (!assuming_client_active) {
if (!assuming_client_active || !state->client.is_active) {
encoder_running = false;
whist_sleep(1);
continue;
Expand Down

0 comments on commit 15b28ba

Please sign in to comment.