Skip to content

Commit

Permalink
opus: add opus_stereo config parameter
Browse files Browse the repository at this point in the history
  opus_stereo    yes   -- Enable stereo (default)
  opus_stereo    no    -- Disable stereo

thanks to Ola Palm for the original patch
  • Loading branch information
alfredh committed Nov 3, 2017
1 parent 1174f97 commit 4cd8d09
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions modules/opus/opus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];


Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 4cd8d09

Please sign in to comment.