aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/test_latency.cpp
diff options
context:
space:
mode:
authorChun-Min Chang <[email protected]>2016-12-21 13:18:07 +0800
committerMatthew Gregan <[email protected]>2016-12-20 19:18:07 -1000
commita900d6e511c3286956c38ca60162790ca6e8e18d (patch)
tree12969af1e27b0d0d127127a60d770b52100f76fb /test/test_latency.cpp
parentc1e1e45dee4367c6f839b903417998049ad1baeb (diff)
downloadcubeb-a900d6e511c3286956c38ca60162790ca6e8e18d.tar.gz
cubeb-a900d6e511c3286956c38ca60162790ca6e8e18d.zip
Support multiple channels on Windows (#171)
* Multiple channel support on Windows * Move up/down mixing code from cubeb_wasapi.cpp to standalone cubeb_mixer.cpp
Diffstat (limited to 'test/test_latency.cpp')
-rw-r--r--test/test_latency.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/test_latency.cpp b/test/test_latency.cpp
index 9843557..69c5eaf 100644
--- a/test/test_latency.cpp
+++ b/test/test_latency.cpp
@@ -9,6 +9,7 @@ TEST(cubeb, latency)
uint32_t max_channels;
uint32_t preferred_rate;
uint32_t latency_frames;
+ cubeb_channel_layout layout;
r = cubeb_init(&ctx, "Cubeb audio test");
ASSERT_EQ(r, CUBEB_OK);
@@ -25,10 +26,17 @@ TEST(cubeb, latency)
ASSERT_GT(preferred_rate, 0u);
}
+ r = cubeb_get_preferred_channel_layout(ctx, &layout);
+ ASSERT_TRUE(r == CUBEB_OK || r == CUBEB_ERROR_NOT_SUPPORTED);
+ if (r == CUBEB_OK) {
+ ASSERT_NE(layout, CUBEB_LAYOUT_UNDEFINED);
+ }
+
cubeb_stream_params params = {
CUBEB_SAMPLE_FLOAT32NE,
preferred_rate,
- max_channels
+ max_channels,
+ (r == CUBEB_OK) ? layout : CUBEB_LAYOUT_UNDEFINED
};
r = cubeb_get_min_latency(ctx, params, &latency_frames);
ASSERT_TRUE(r == CUBEB_OK || r == CUBEB_ERROR_NOT_SUPPORTED);