Skip to content

Commit 15dc83f

Browse files
committed
Always enable resampler stats
The define causes trouble with Firefox's build system and it's not obvious how to fix it properly. This is harmless enough and will probably be DCEed.
1 parent 34ff385 commit 15dc83f

File tree

4 files changed

+0
-15
lines changed

4 files changed

+0
-15
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ else()
4242
endif()
4343

4444
if(BUILD_TESTS)
45-
add_definitions(-DGTEST_ENABLED=1)
4645
find_package(GTest QUIET)
4746
if(TARGET GTest::Main)
4847
add_library(gtest_main ALIAS GTest::Main)

src/cubeb_resampler.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,8 @@ cubeb_resampler_latency(cubeb_resampler * resampler)
372372
return resampler->latency();
373373
}
374374

375-
#ifdef GTEST_ENABLED
376375
cubeb_resampler_stats
377376
cubeb_resampler_stats_get(cubeb_resampler * resampler)
378377
{
379378
return resampler->stats();
380379
}
381-
#endif

src/cubeb_resampler.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ cubeb_resampler_latency(cubeb_resampler * resampler);
8888
* Test-only introspection API to ensure that there is no buffering
8989
* buildup when resampling.
9090
*/
91-
#ifdef GTEST_ENABLED
9291
typedef struct {
9392
size_t input_input_buffer_size;
9493
size_t input_output_buffer_size;
@@ -98,7 +97,6 @@ typedef struct {
9897

9998
cubeb_resampler_stats
10099
cubeb_resampler_stats_get(cubeb_resampler * resampler);
101-
#endif
102100

103101
#if defined(__cplusplus)
104102
}

src/cubeb_resampler_internal.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ struct cubeb_resampler {
5656
virtual long fill(void * input_buffer, long * input_frames_count,
5757
void * output_buffer, long frames_needed) = 0;
5858
virtual long latency() = 0;
59-
#ifdef GTEST_ENABLED
6059
virtual cubeb_resampler_stats stats() = 0;
61-
#endif
6260
virtual ~cubeb_resampler() {}
6361
};
6462

@@ -89,7 +87,6 @@ class passthrough_resampler : public cubeb_resampler, public processor {
8987

9088
virtual long latency() { return 0; }
9189

92-
#ifdef GTEST_ENABLED
9390
virtual cubeb_resampler_stats stats()
9491
{
9592
cubeb_resampler_stats stats;
@@ -99,7 +96,6 @@ class passthrough_resampler : public cubeb_resampler, public processor {
9996
stats.output_output_buffer_size = 0;
10097
return stats;
10198
}
102-
#endif
10399

104100
void drop_audio_if_needed()
105101
{
@@ -137,7 +133,6 @@ class cubeb_resampler_speex : public cubeb_resampler {
137133
virtual long fill(void * input_buffer, long * input_frames_count,
138134
void * output_buffer, long output_frames_needed);
139135

140-
#ifdef GTEST_ENABLED
141136
virtual cubeb_resampler_stats stats()
142137
{
143138
cubeb_resampler_stats stats = {};
@@ -151,7 +146,6 @@ class cubeb_resampler_speex : public cubeb_resampler {
151146
}
152147
return stats;
153148
}
154-
#endif
155149

156150
virtual long latency()
157151
{
@@ -361,10 +355,8 @@ template <typename T> class cubeb_resampler_speex_one_way : public processor {
361355
}
362356
}
363357

364-
#ifdef GTEST_ENABLED
365358
size_t input_buffer_size() const { return resampling_in_buffer.length(); }
366359
size_t output_buffer_size() const { return resampling_out_buffer.length(); }
367-
#endif
368360

369361
private:
370362
/** Wrapper for the speex resampling functions to have a typed
@@ -514,10 +506,8 @@ template <typename T> class delay_line : public processor {
514506
}
515507
}
516508

517-
#ifdef GTEST_ENABLED
518509
size_t input_buffer_size() const { return delay_input_buffer.length(); }
519510
size_t output_buffer_size() const { return delay_output_buffer.length(); }
520-
#endif
521511

522512
private:
523513
/** The length, in frames, of this delay line */

0 commit comments

Comments
 (0)