13
0

Export a variable which can't be accessed via a 'get()' function

Temporal::most_recent_engine_sample_rate is used in performance-critical code so shouldn't be accessed via a 'get()' function. But (via the TEMPORAL_SAMPLE_RATE #define) it does get accessed outside of libtemporal and therefore needs to get exported.
This commit is contained in:
John Emmas 2022-05-04 16:09:34 +01:00
parent 28231d6365
commit 2554302281

View File

@ -50,7 +50,7 @@ static inline superclock_t superclock_ticks_per_second() { return _superclock_ti
static inline superclock_t superclock_to_samples (superclock_t s, int sr) { return int_div_round (s * sr, superclock_ticks_per_second()); }
static inline superclock_t samples_to_superclock (int64_t samples, int sr) { return int_div_round (samples * superclock_ticks_per_second(), superclock_t (sr)); }
extern int most_recent_engine_sample_rate;
LIBTEMPORAL_API extern int most_recent_engine_sample_rate;
LIBTEMPORAL_API void set_sample_rate (int sr);
LIBTEMPORAL_API void set_superclock_ticks_per_second (superclock_t sc);