From 3694925022aa16b10978c92b9a2a69661dbbcdcf Mon Sep 17 00:00:00 2001 From: dvdli Date: Thu, 28 Jan 2021 15:03:17 +0800 Subject: Let pcm_mmap_read/write call pcm_readi/writei The pcm_readi and pcm_writei also can deal with the mmap read/write. Also mark the pcm_mmap_read/write functions as deprecated functions and update the test case. Add mmap playback support to tinyplay --- tests/src/pcm_out_test.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/src/pcm_out_test.cc b/tests/src/pcm_out_test.cc index cbc6983..f8d4345 100644 --- a/tests/src/pcm_out_test.cc +++ b/tests/src/pcm_out_test.cc @@ -192,13 +192,13 @@ TEST_F(PcmOutMmapTest, Write) { buffer[i] = static_cast(i); } - int written_frames = 0; + int res = 0; unsigned int frames = pcm_bytes_to_frames(pcm_object, buffer_size); pcm_start(pcm_object); auto start = std::chrono::steady_clock::now(); for (uint32_t i = 0; i < write_count; ++i) { - written_frames = pcm_mmap_write(pcm_object, buffer.get(), buffer_size); - ASSERT_EQ(written_frames, frames); + res = pcm_mmap_write(pcm_object, buffer.get(), buffer_size); + ASSERT_EQ(res, 0); } pcm_stop(pcm_object); -- cgit v1.2.3