summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-01-10 18:18:07 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-01-10 18:18:07 +0100
commit319172854c238795585ce42c6fb357833b6b2bda (patch)
tree7895c1c388bbb5ee4b13fec02cfbf414bd638c8e
parent90c973307607be9ed8f943a79a36a28a46c07502 (diff)
downloadODR-AudioEnc-319172854c238795585ce42c6fb357833b6b2bda.tar.gz
ODR-AudioEnc-319172854c238795585ce42c6fb357833b6b2bda.tar.bz2
ODR-AudioEnc-319172854c238795585ce42c6fb357833b6b2bda.zip
Enable VLC compressor only if required
-rw-r--r--src/VLCInput.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/VLCInput.cpp b/src/VLCInput.cpp
index 4ec9208..f527f20 100644
--- a/src/VLCInput.cpp
+++ b/src/VLCInput.cpp
@@ -136,9 +136,17 @@ int VLCInput::prepare()
// VLC options
+ std::stringstream transcode_options_ss;
+ transcode_options_ss << "acodec=s16l";
+ transcode_options_ss << ",samplerate=" << m_rate;
+ if (not m_gain.empty()) {
+ transcode_options_ss << ",afilter=compressor";
+ }
+ string transcode_options = transcode_options_ss.str();
+
char smem_options[512];
snprintf(smem_options, sizeof(smem_options),
- "#transcode{acodec=s16l,samplerate=%d,afilter=compressor}:"
+ "#transcode{%s}:"
// We are using transcode because smem only support raw audio and
// video formats
"smem{"
@@ -146,7 +154,7 @@ int VLCInput::prepare()
"audio-prerender-callback=%lld,"
"audio-data=%lld"
"}",
- m_rate,
+ transcode_options.c_str(),
handleStream_address,
prepareRender_address,
(long long int)(intptr_t)this);