From 455786e07d6ea91bc8af639723f64ae367d6b4c6 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 7 Aug 2016 20:25:58 +0200 Subject: [PATCH] Prepare for inputs of another frequency than the capture frequency. --- audio_mixer.cpp | 2 +- audio_mixer.h | 1 + defs.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/audio_mixer.cpp b/audio_mixer.cpp index a534aac..88ca8c6 100644 --- a/audio_mixer.cpp +++ b/audio_mixer.cpp @@ -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; } diff --git a/audio_mixer.h b/audio_mixer.h index c7841fb..93c9beb 100644 --- a/audio_mixer.h +++ b/audio_mixer.h @@ -177,6 +177,7 @@ private: std::unique_ptr 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 interesting_channels; }; diff --git a/defs.h b/defs.h index 4ec3a91..b64aeef 100644 --- 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 -- 2.39.2