From 855354a87d2983e190088bc5330c129094b900ca Mon Sep 17 00:00:00 2001 From: dvdli Date: Tue, 12 Jan 2021 14:53:42 +0800 Subject: remove pcm_prepare in pcm_open For the dynamic pcm device, it is valid to specify the backend after opening it. However, it is invalid to call prepare on a dynamic pcm device without connecting any backend device. We should not do pcm_prepare in pcm_open. See also: Issue #197 --- tests/src/pcm_in_test.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/src/pcm_in_test.cc') diff --git a/tests/src/pcm_in_test.cc b/tests/src/pcm_in_test.cc index e912abb..5491b00 100644 --- a/tests/src/pcm_in_test.cc +++ b/tests/src/pcm_in_test.cc @@ -47,6 +47,7 @@ class PcmInTest : public ::testing::Test { pcm_object = pcm_open(kLoopbackCard, kLoopbackCaptureDevice, PCM_IN, &kDefaultConfig); ASSERT_NE(pcm_object, nullptr); ASSERT_TRUE(pcm_is_ready(pcm_object)); + pcm_prepare(pcm_object); } virtual void TearDown() override { -- cgit v1.2.3 From c0f924738de2b8f5478e8b454b4ad5521802f3f6 Mon Sep 17 00:00:00 2001 From: dvdli Date: Thu, 28 Jan 2021 11:53:30 +0800 Subject: prepare in pcm_generic_transfer --- tests/src/pcm_in_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/src/pcm_in_test.cc') diff --git a/tests/src/pcm_in_test.cc b/tests/src/pcm_in_test.cc index 5491b00..4d8a697 100644 --- a/tests/src/pcm_in_test.cc +++ b/tests/src/pcm_in_test.cc @@ -47,7 +47,6 @@ class PcmInTest : public ::testing::Test { pcm_object = pcm_open(kLoopbackCard, kLoopbackCaptureDevice, PCM_IN, &kDefaultConfig); ASSERT_NE(pcm_object, nullptr); ASSERT_TRUE(pcm_is_ready(pcm_object)); - pcm_prepare(pcm_object); } virtual void TearDown() override { @@ -74,6 +73,7 @@ class PcmInTest : public ::testing::Test { }; TEST_F(PcmInTest, GetDelay) { + pcm_prepare(pcm_object); long delay = pcm_get_delay(pcm_object); std::cout << delay << std::endl; ASSERT_GE(delay, 0); -- cgit v1.2.3