]> git.sesse.net Git - nageru/commitdiff
Rename reset_device to reset_resampler.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 13 Aug 2016 11:45:24 +0000 (13:45 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 19 Oct 2016 22:55:44 +0000 (00:55 +0200)
audio_mixer.cpp
audio_mixer.h
mixer.cpp

index 30fe9cbb77b95bc123e52e017170372b199e72cf..c1f74107ff382403f9112e04f7d312a65185d3ac 100644 (file)
@@ -106,15 +106,16 @@ AudioMixer::AudioMixer(unsigned num_cards)
        set_input_mapping(new_input_mapping);
 }
 
-void AudioMixer::reset_device(DeviceSpec device_spec)
+void AudioMixer::reset_resampler(DeviceSpec device_spec)
 {
        lock_guard<mutex> lock(audio_mutex);
-       reset_device_mutex_held(device_spec);
+       reset_resampler_mutex_held(device_spec);
 }
 
-void AudioMixer::reset_device_mutex_held(DeviceSpec device_spec)
+void AudioMixer::reset_resampler_mutex_held(DeviceSpec device_spec)
 {
        AudioDevice *device = find_audio_device(device_spec);
+
        if (device->interesting_channels.empty()) {
                device->resampling_queue.reset();
        } else {
@@ -450,7 +451,7 @@ void AudioMixer::set_input_mapping(const InputMapping &new_input_mapping)
                AudioDevice *device = find_audio_device(device_spec);
                if (device->interesting_channels != interesting_channels[device_spec]) {
                        device->interesting_channels = interesting_channels[device_spec];
-                       reset_device_mutex_held(device_spec);
+                       reset_resampler_mutex_held(device_spec);
                }
        }
 
index cee5f700a9e5b4645e5eaef9f32212ee51c96833..30675b88b6f8bfbb5cddbaf635bee42ebb97da33 100644 (file)
@@ -74,7 +74,7 @@ struct InputMapping {
 class AudioMixer {
 public:
        AudioMixer(unsigned num_cards);
-       void reset_device(DeviceSpec device_spec);
+       void reset_resampler(DeviceSpec device_spec);
 
        // frame_length is in TIMEBASE units.
        void add_audio(DeviceSpec device_spec, const uint8_t *data, unsigned num_samples, bmusb::AudioFormat audio_format, int64_t frame_length);
@@ -209,7 +209,7 @@ private:
 
        void find_sample_src_from_device(const std::map<DeviceSpec, std::vector<float>> &samples_card, DeviceSpec device_spec, int source_channel, const float **srcptr, unsigned *stride);
        void fill_audio_bus(const std::map<DeviceSpec, std::vector<float>> &samples_card, const InputMapping::Bus &bus, unsigned num_samples, float *output);
-       void reset_device_mutex_held(DeviceSpec device_spec);
+       void reset_resampler_mutex_held(DeviceSpec device_spec);
        std::map<DeviceSpec, DeviceInfo> get_devices_mutex_held() const;
 
        unsigned num_cards;
index e0371429bc9dc3f678ffb80d0dfb37bf6c3bfdd6..9eed47ea8f33414f97e6ec3482f164b7c99da5be 100644 (file)
--- a/mixer.cpp
+++ b/mixer.cpp
@@ -287,7 +287,7 @@ void Mixer::configure_card(unsigned card_index, CaptureInterface *capture, bool
        card->capture->configure_card();
 
        DeviceSpec device{InputSourceType::CAPTURE_CARD, card_index};
-       audio_mixer.reset_device(device);
+       audio_mixer.reset_resampler(device);
        audio_mixer.set_name(device, card->capture->get_description());
 }
 
@@ -384,7 +384,7 @@ void Mixer::bm_frame(unsigned card_index, uint16_t timecode,
        if (dropped_frames > MAX_FPS * 2) {
                fprintf(stderr, "Card %d lost more than two seconds (or time code jumping around; from 0x%04x to 0x%04x), resetting resampler\n",
                        card_index, card->last_timecode, timecode);
-               audio_mixer.reset_device(device);
+               audio_mixer.reset_resampler(device);
                dropped_frames = 0;
        } else if (dropped_frames > 0) {
                // Insert silence as needed.