Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gavv committed May 4, 2024
1 parent c1beab3 commit a1d7d6b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/module-roc-sink-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PA_MODULE_USAGE("local_ip=<local receiver ip> "
"local_control_port=<local receiver port for control (RTCP) packets> "
"sink=<name for the sink> "
"sink_input_properties=<properties for the sink input> "
"sink_input_rate<sample rate> "
"sink_input_rate=<sample rate> "
"sink_input_format=f32 "
"sink_input_chans=mono|stereo "
"packet_encoding_id=<8-bit number> "
Expand Down Expand Up @@ -77,9 +77,9 @@ static const char* const roc_sink_input_modargs[] = {
"sink",
"sink_input_name",
"sink_input_properties",
"sink_rate",
"sink_format",
"sink_chans",
"sink_input_rate",
"sink_input_format",
"sink_input_chans",
"packet_encoding_id",
"packet_encoding_rate",
"packet_encoding_format",
Expand Down
6 changes: 4 additions & 2 deletions src/module-roc-sink.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ PA_MODULE_USAGE("remote_ip=<remote receiver ip> "
"remote_control_port=<remote receiver port for control (RTCP) packets> "
"sink_name=<name for the sink> "
"sink_properties=<properties for the sink> "
"sink_rate<sample rate> "
"sink_rate=<sample rate> "
"sink_format=f32 "
"sink_chans=mono|stereo "
"packet_encoding_id=<8-bit number> "
Expand Down Expand Up @@ -285,7 +285,9 @@ int pa__init(pa_module* m) {
goto error;
}

if (sender_config.packet_encoding != 0) {
if (sender_config.packet_encoding == 0) {
sender_config.packet_encoding = ROC_PACKET_ENCODING_AVP_L16_STEREO;
} else {
roc_media_encoding encoding;
memset(&encoding, 0, sizeof(encoding));

Expand Down
2 changes: 1 addition & 1 deletion src/rocpulse_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ int rocpulse_parse_media_encoding(roc_media_encoding* out,
const char* chans = pa_modargs_get_value(args, chans_arg_name, "stereo");
if (!chans || !*chans || strcmp(chans, "stereo") == 0) {
out->channels = ROC_CHANNEL_LAYOUT_STEREO;
} else if (strcmp(chans, "mono")) {
} else if (strcmp(chans, "mono") == 0) {
out->channels = ROC_CHANNEL_LAYOUT_MONO;
} else {
pa_log("invalid %s: %s", chans_arg_name, chans);
Expand Down

0 comments on commit a1d7d6b

Please sign in to comment.