summaryrefslogtreecommitdiff
path: root/modules/opus
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-11-03 18:28:30 +0100
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-11-03 18:28:30 +0100
commit4cd8d09b5de8218369a420ec41023b32d3644c3f (patch)
tree277b758aeb8082a28216de59bc5bc3a2281e6f0f /modules/opus
parent1174f976113306b1e77736bfe9bd5ac9dab598a8 (diff)
opus: add opus_stereo config parameter
opus_stereo yes -- Enable stereo (default) opus_stereo no -- Disable stereo thanks to Ola Palm for the original patch
Diffstat (limited to 'modules/opus')
-rw-r--r--modules/opus/opus.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/opus/opus.c b/modules/opus/opus.c
index 881596e..d1802a8 100644
--- a/modules/opus/opus.c
+++ b/modules/opus/opus.c
@@ -36,7 +36,7 @@
static bool opus_mirror;
-static char fmtp[256] = "stereo=1;sprop-stereo=1";
+static char fmtp[256] = "";
static char fmtp_mirror[256];
@@ -88,9 +88,19 @@ static int module_init(void)
struct conf *conf = conf_cur();
uint32_t value;
char *p = fmtp + str_len(fmtp);
- bool b;
+ bool b, stereo = true;
int n = 0;
+ conf_get_bool(conf, "opus_stereo", &stereo);
+
+ /* always set stereo parameter first */
+ n = re_snprintf(p, sizeof(fmtp) - str_len(p),
+ "stereo=%d;sprop-stereo=%d", stereo, stereo);
+ if (n <= 0)
+ return ENOMEM;
+
+ p += n;
+
if (0 == conf_get_u32(conf, "opus_bitrate", &value)) {
n = re_snprintf(p, sizeof(fmtp) - str_len(p),