From a1d7d6b5b0bb54140f6fa8420aaa965daae20896 Mon Sep 17 00:00:00 2001 From: Victor Gaydov Date: Sat, 4 May 2024 21:09:20 +0400 Subject: [PATCH] Bug fixes --- src/module-roc-sink-input.c | 8 ++++---- src/module-roc-sink.c | 6 ++++-- src/rocpulse_helpers.c | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/module-roc-sink-input.c b/src/module-roc-sink-input.c index 6f2a32d..2c2a21f 100644 --- a/src/module-roc-sink-input.c +++ b/src/module-roc-sink-input.c @@ -38,7 +38,7 @@ PA_MODULE_USAGE("local_ip= " "local_control_port= " "sink= " "sink_input_properties= " - "sink_input_rate " + "sink_input_rate= " "sink_input_format=f32 " "sink_input_chans=mono|stereo " "packet_encoding_id=<8-bit number> " @@ -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", diff --git a/src/module-roc-sink.c b/src/module-roc-sink.c index 6221926..9c61f46 100644 --- a/src/module-roc-sink.c +++ b/src/module-roc-sink.c @@ -40,7 +40,7 @@ PA_MODULE_USAGE("remote_ip= " "remote_control_port= " "sink_name= " "sink_properties= " - "sink_rate " + "sink_rate= " "sink_format=f32 " "sink_chans=mono|stereo " "packet_encoding_id=<8-bit number> " @@ -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)); diff --git a/src/rocpulse_helpers.c b/src/rocpulse_helpers.c index 78e866a..ce09467 100644 --- a/src/rocpulse_helpers.c +++ b/src/rocpulse_helpers.c @@ -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);