Skip to content

Commit

Permalink
Fixed formatting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jbwong05 committed Jul 19, 2023
1 parent cd05f38 commit 7c3ee6b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
21 changes: 13 additions & 8 deletions src/pulse-app-input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ static int_fast32_t pulse_start_recording(struct pulse_data *data)
//string monitor_name = "OBSPulseAppRecord" +
// string(data->sink_input_sink_name) + ".monitor";
if (pulse_get_source_info_by_name(pulse_source_info,
data->sink_monitor_source_name, data) < 0) {
data->sink_monitor_source_name,
data) < 0) {
blog(LOG_ERROR, "Unable to get monitor source info !");
return -1;
}
Expand Down Expand Up @@ -348,10 +349,14 @@ static int_fast32_t pulse_start_recording(struct pulse_data *data)

pa_stream_flags_t flags = PA_STREAM_ADJUST_LATENCY;

blog(LOG_INFO, "attempting to only monitor sink input %d", data->sink_input_idx);
int status = pa_stream_set_monitor_stream(data->stream, data->sink_input_idx);
blog(LOG_INFO, "attempting to only monitor sink input %d",
data->sink_input_idx);
int status = pa_stream_set_monitor_stream(data->stream,
data->sink_input_idx);
if (status != 0) {
blog(LOG_ERROR, "Failed to only record sink input from monitor: %d", status);
blog(LOG_ERROR,
"Failed to only record sink input from monitor: %d",
status);
return -1;
}

Expand Down Expand Up @@ -503,7 +508,7 @@ static void pulse_app_input_destroy(void *vptr)

if (data->client)
bfree(data->client);

if (data->sink_monitor_source_name)
bfree(data->sink_monitor_source_name);

Expand Down Expand Up @@ -541,15 +546,15 @@ static void refresh_recording(struct pulse_data *data)
if (!get_sink_input(data)) {
return;
}
bool change = prev_sink_input_idx != data->sink_input_idx || prev_sink_idx != data->sink_idx;
bool change = prev_sink_input_idx != data->sink_input_idx ||
prev_sink_idx != data->sink_idx;

if(change) {
if (change) {
if (data->stream) {
blog(LOG_INFO, "stopping recording");
pulse_stop_recording(data);
}

// Start recording from the combine module
blog(LOG_INFO, "starting recording");
pulse_start_recording(data);
}
Expand Down
18 changes: 9 additions & 9 deletions src/pulse-wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ int_fast32_t pulse_get_client_info_list(pa_client_info_cb_t cb, void *userdata)
}

int_fast32_t pulse_get_source_info_by_idx(pa_source_info_cb_t cb, uint32_t idx,
void *userdata)
void *userdata)
{
if (pulse_context_ready() < 0)
return -1;
Expand Down Expand Up @@ -292,16 +292,15 @@ int_fast32_t pulse_get_sink_input_info_list(pa_sink_input_info_cb_t cb,
return 0;
}

int_fast32_t pulse_get_sink_info_list(pa_sink_info_cb_t cb,
void *userdata)
int_fast32_t pulse_get_sink_info_list(pa_sink_info_cb_t cb, void *userdata)
{
if (pulse_context_ready() < 0)
return -1;

pulse_lock();

pa_operation *op = pa_context_get_sink_info_list(pulse_context,
cb, userdata);
pa_operation *op =
pa_context_get_sink_info_list(pulse_context, cb, userdata);
if (!op) {
pulse_unlock();
return -1;
Expand Down Expand Up @@ -440,7 +439,7 @@ static void subscribe_cb(pa_context *c, int success, void *userdata)
}

int_fast32_t pulse_subscribe_events(pa_context_subscribe_cb_t cb,
void *userdata)
void *userdata)
{
if (pulse_context_ready() < 0)
return -1;
Expand All @@ -449,9 +448,10 @@ int_fast32_t pulse_subscribe_events(pa_context_subscribe_cb_t cb,

bool success = true;

pa_operation *op = pa_context_subscribe(pulse_context,
PA_SUBSCRIPTION_MASK_SINK_INPUT | PA_SUBSCRIPTION_MASK_SINK,
subscribe_cb, &success);
pa_operation *op = pa_context_subscribe(
pulse_context,
PA_SUBSCRIPTION_MASK_SINK_INPUT | PA_SUBSCRIPTION_MASK_SINK,
subscribe_cb, &success);
if (!op) {
pulse_unlock();
return -1;
Expand Down

0 comments on commit 7c3ee6b

Please sign in to comment.