diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-05-04 16:05:47 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-05-04 16:05:47 +0200 |
commit | 55fe285c56055497725a619e5b9acbd6dec57e23 (patch) | |
tree | ee9fc752adddd8ef75b4e2c94c0e8ef914411c28 /src/odr-audioenc.cpp | |
parent | 20607d9aff6b1cee10fec1c7efc815ae2d77518c (diff) | |
download | ODR-AudioEnc-55fe285c56055497725a619e5b9acbd6dec57e23.tar.gz ODR-AudioEnc-55fe285c56055497725a619e5b9acbd6dec57e23.tar.bz2 ODR-AudioEnc-55fe285c56055497725a619e5b9acbd6dec57e23.zip |
Fix teardown after silence detector trigger
Diffstat (limited to 'src/odr-audioenc.cpp')
-rw-r--r-- | src/odr-audioenc.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/odr-audioenc.cpp b/src/odr-audioenc.cpp index 9a0b0c4..9264ac7 100644 --- a/src/odr-audioenc.cpp +++ b/src/odr-audioenc.cpp @@ -491,7 +491,7 @@ public: unique_ptr<AACDecoder> decoder; unique_ptr<StatsPublisher> stats_publisher; - AudioEnc() : queue(BYTES_PER_SAMPLE, channels, 0, drift_compensation) { } + AudioEnc() : queue(BYTES_PER_SAMPLE) { } AudioEnc(const AudioEnc&) = delete; AudioEnc& operator=(const AudioEnc&) = delete; ~AudioEnc(); @@ -764,7 +764,7 @@ int AudioEnc::run() /*! The SampleQueue \c queue is given to the inputs, so that they * can fill it. */ - queue.set_max_size(max_size); + queue.configure(max_size, not drift_compensation, channels); /* symsize=8, gfpoly=0x11d, fcr=0, prim=1, nroots=10, pad=135 */ rs_handler = init_rs_char(8, 0x11d, 0, 1, 10, 135); @@ -1319,20 +1319,17 @@ shared_ptr<InputInterface> AudioEnc::initialise_input() shared_ptr<InputInterface> input; if (not infile.empty()) { - input = make_shared<FileInput>(infile, raw_input, sample_rate, - continue_after_eof, queue); + input = make_shared<FileInput>(infile, raw_input, sample_rate, continue_after_eof, queue); } #if HAVE_JACK else if (not jack_name.empty()) { - input = make_shared<JackInput>(jack_name, channels, sample_rate, - queue); + input = make_shared<JackInput>(jack_name, channels, sample_rate, queue); } #endif #if HAVE_VLC else if (not vlc_uri.empty()) { - input = make_shared<VLCInput>(vlc_uri, sample_rate, channels, - verbosity, vlc_gain, vlc_cache, vlc_additional_opts, - queue); + input = make_shared<VLCInput>(vlc_uri, sample_rate, channels, verbosity, + vlc_gain, vlc_cache, vlc_additional_opts, queue); } #endif #if HAVE_GST @@ -1342,12 +1339,10 @@ shared_ptr<InputInterface> AudioEnc::initialise_input() #endif #if HAVE_ALSA else if (drift_compensation) { - input = make_shared<AlsaInputThreaded>(alsa_device, channels, - sample_rate, queue); + input = make_shared<AlsaInputThreaded>(alsa_device, channels, sample_rate, queue); } else { - input = make_shared<AlsaInputDirect>(alsa_device, channels, - sample_rate, queue); + input = make_shared<AlsaInputDirect>(alsa_device, channels, sample_rate, queue); } #endif |