]> git.sesse.net Git - nageru/commitdiff
Prepare for inputs of another frequency than the capture frequency.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 7 Aug 2016 18:25:58 +0000 (20:25 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 19 Oct 2016 22:55:44 +0000 (00:55 +0200)
audio_mixer.cpp
audio_mixer.h
defs.h

index a534aace6b656196df8343062e203ae00435f339..88ca8c617a8559ce771e21f1e337133bba51296c 100644 (file)
@@ -120,7 +120,7 @@ void AudioMixer::reset_device_mutex_held(DeviceSpec device_spec)
        } else {
                // TODO: ResamplingQueue should probably take the full device spec.
                // (It's only used for console output, though.)
-               device->resampling_queue.reset(new ResamplingQueue(device_spec.index, OUTPUT_FREQUENCY, OUTPUT_FREQUENCY, device->interesting_channels.size()));
+               device->resampling_queue.reset(new ResamplingQueue(device_spec.index, device->capture_frequency, OUTPUT_FREQUENCY, device->interesting_channels.size()));
        }
        device->next_local_pts = 0;
 }
index c7841fbdf32125116803af67dfffe4d0f3c66a34..93c9beb375768c3ed1707b8c8fec764bda017400 100644 (file)
@@ -177,6 +177,7 @@ private:
                std::unique_ptr<ResamplingQueue> resampling_queue;
                int64_t next_local_pts = 0;
                std::string name;
+               unsigned capture_frequency = OUTPUT_FREQUENCY;
                // Which channels we consider interesting (ie., are part of some input_mapping).
                std::set<unsigned> interesting_channels;
        };
diff --git a/defs.h b/defs.h
index 4ec3a91bce6df70018ea67035086a76c702a7fce..b64aeef8e26a7e23e423d4516aeda7a530c546bd 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -1,7 +1,7 @@
 #ifndef _DEFS_H
 #define _DEFS_H
 
-#define OUTPUT_FREQUENCY 48000
+#define OUTPUT_FREQUENCY 48000  // Currently needs to be exactly 48000, since bmusb outputs in that.
 #define MAX_FPS 60
 #define WIDTH 1280
 #define HEIGHT 720