From f64fb3998ccb438cbda2b8eafa8e33462f1e652d Mon Sep 17 00:00:00 2001 From: dvdli Date: Mon, 7 Dec 2020 18:34:13 +0800 Subject: fix bugs in the pcm_open_* functions 1. Align the document and the code. 2. Copy error messages to bad_pcm object for client to get more info when opening failed. --- src/pcm.c | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/src/pcm.c b/src/pcm.c index 98ca9eb..17775d5 100644 --- a/src/pcm.c +++ b/src/pcm.c @@ -995,24 +995,25 @@ int pcm_close(struct pcm *pcm) * - @ref PCM_MONOTONIC * @param config The hardware and software parameters to open the PCM with. * @returns A PCM structure. - * If an error occurs allocating memory for the PCM, NULL is returned. - * Otherwise, client code should check that the PCM opened properly by calling @ref pcm_is_ready. - * If @ref pcm_is_ready, check @ref pcm_get_error for more information. + * If an error occurs, the pointer of bad_pcm is returned. + * Otherwise, it returns the pointer of PCM object. + * Client code should check that the PCM opened properly by calling @ref pcm_is_ready. + * If @ref pcm_is_ready returns false, check @ref pcm_get_error for more information. * @ingroup libtinyalsa-pcm */ struct pcm *pcm_open_by_name(const char *name, unsigned int flags, const struct pcm_config *config) { - unsigned int card, device; - if ((name[0] != 'h') - || (name[1] != 'w') - || (name[2] != ':')) { - return NULL; - } else if (sscanf(&name[3], "%u,%u", &card, &device) != 2) { - return NULL; - } - return pcm_open(card, device, flags, config); + unsigned int card, device; + if (name[0] != 'h' || name[1] != 'w' || name[2] != ':') { + oops(&bad_pcm, 0, "name format is not matched"); + return &bad_pcm; + } else if (sscanf(&name[3], "%u,%u", &card, &device) != 2) { + oops(&bad_pcm, 0, "name format is not matched"); + return &bad_pcm; + } + return pcm_open(card, device, flags, config); } /** Opens a PCM. @@ -1029,9 +1030,10 @@ struct pcm *pcm_open_by_name(const char *name, * - @ref PCM_MONOTONIC * @param config The hardware and software parameters to open the PCM with. * @returns A PCM structure. - * If an error occurs allocating memory for the PCM, NULL is returned. - * Otherwise, client code should check that the PCM opened properly by calling @ref pcm_is_ready. - * If @ref pcm_is_ready, check @ref pcm_get_error for more information. + * If an error occurs, the pointer of bad_pcm is returned. + * Otherwise, it returns the pointer of PCM object. + * Client code should check that the PCM opened properly by calling @ref pcm_is_ready. + * If @ref pcm_is_ready returns false, check @ref pcm_get_error for more information. * @ingroup libtinyalsa-pcm */ struct pcm *pcm_open(unsigned int card, unsigned int device, @@ -1042,8 +1044,10 @@ struct pcm *pcm_open(unsigned int card, unsigned int device, int rc; pcm = calloc(1, sizeof(struct pcm)); - if (!pcm) + if (!pcm) { + oops(&bad_pcm, ENOMEM, "can't allocate PCM object"); return &bad_pcm; + } /* Default to hw_ops, attemp plugin open only if hw (/dev/snd/pcm*) open fails */ pcm->ops = &hw_ops; @@ -1055,7 +1059,7 @@ struct pcm *pcm_open(unsigned int card, unsigned int device, pcm->snd_node = snd_utils_open_pcm(card, device); pcm_type = snd_utils_get_node_type(pcm->snd_node); if (!pcm->snd_node || pcm_type != SND_NODE_TYPE_PLUGIN) { - oops(pcm, -ENODEV, "no device (hw/plugin) for card(%u), device(%u)", + oops(&bad_pcm, ENODEV, "no device (hw/plugin) for card(%u), device(%u)", card, device); goto fail_close_dev_node; } @@ -1064,7 +1068,7 @@ struct pcm *pcm_open(unsigned int card, unsigned int device, } #endif if (pcm->fd < 0) { - oops(pcm, errno, "cannot open device (%u) for card (%u)", + oops(&bad_pcm, errno, "cannot open device (%u) for card (%u)", device, card); goto fail_close_dev_node; } @@ -1072,7 +1076,7 @@ struct pcm *pcm_open(unsigned int card, unsigned int device, pcm->flags = flags; if (pcm->ops->ioctl(pcm->data, SNDRV_PCM_IOCTL_INFO, &info)) { - oops(pcm, errno, "cannot get info"); + oops(&bad_pcm, errno, "cannot get info"); goto fail_close; } pcm->subdevice = info.subdevice; @@ -1082,7 +1086,7 @@ struct pcm *pcm_open(unsigned int card, unsigned int device, rc = pcm_hw_mmap_status(pcm); if (rc < 0) { - oops(pcm, errno, "mmap status failed"); + oops(&bad_pcm, errno, "mmap status failed"); goto fail; } @@ -1091,7 +1095,7 @@ struct pcm *pcm_open(unsigned int card, unsigned int device, int arg = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC; rc = pcm->ops->ioctl(pcm->data, SNDRV_PCM_IOCTL_TTSTAMP, &arg); if (rc < 0) { - oops(pcm, errno, "cannot set timestamp type"); + oops(&bad_pcm, errno, "cannot set timestamp type"); goto fail; } } -- cgit v1.2.3 From 565fc0e3da9bf0ccea99eb4386a4890cdba56134 Mon Sep 17 00:00:00 2001 From: dvdli Date: Wed, 9 Dec 2020 15:45:04 +0800 Subject: fix mmap-related functions' bugs 1. sync hw ptr before calculating the avail 2. return zero when reading or writing successfully --- src/pcm.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/pcm.c b/src/pcm.c index 17775d5..169d982 100644 --- a/src/pcm.c +++ b/src/pcm.c @@ -1242,6 +1242,7 @@ static inline int pcm_mmap_capture_avail(struct pcm *pcm) int pcm_mmap_avail(struct pcm *pcm) { + pcm_sync_ptr(pcm, SNDRV_PCM_SYNC_PTR_HWSYNC); if (pcm->flags & PCM_IN) return pcm_mmap_capture_avail(pcm); else @@ -1552,8 +1553,14 @@ int pcm_mmap_write(struct pcm *pcm, const void *data, unsigned int count) if ((~pcm->flags) & (PCM_OUT | PCM_MMAP)) return -ENOSYS; - return pcm_mmap_transfer(pcm, (void *)data, - pcm_bytes_to_frames(pcm, count)); + unsigned int frames = pcm_bytes_to_frames(pcm, count); + int res = pcm_mmap_transfer(pcm, (void *) data, frames); + + if (res < 0) { + return res; + } + + return (unsigned int) res == frames ? 0 : -EIO; } int pcm_mmap_read(struct pcm *pcm, void *data, unsigned int count) @@ -1561,7 +1568,14 @@ int pcm_mmap_read(struct pcm *pcm, void *data, unsigned int count) if ((~pcm->flags) & (PCM_IN | PCM_MMAP)) return -ENOSYS; - return pcm_mmap_transfer(pcm, data, pcm_bytes_to_frames(pcm, count)); + unsigned int frames = pcm_bytes_to_frames(pcm, count); + int res = pcm_mmap_transfer(pcm, data, frames); + + if (res < 0) { + return res; + } + + return (unsigned int) res == frames ? 0 : -EIO; } /* Returns current read/write position in the mmap buffer with associated time stamp. */ -- cgit v1.2.3 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 --- examples/pcm-readi.c | 1 + examples/pcm-writei.c | 1 + src/pcm.c | 4 ---- tests/src/pcm_in_test.cc | 1 + tests/src/pcm_loopback_test.cc | 2 ++ tests/src/pcm_out_test.cc | 2 ++ utils/tinycap.c | 1 + utils/tinyplay.c | 1 + 8 files changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/pcm-readi.c b/examples/pcm-readi.c index 8722b41..dc18b63 100644 --- a/examples/pcm-readi.c +++ b/examples/pcm-readi.c @@ -29,6 +29,7 @@ static size_t read_frames(void **frames) fprintf(stderr, "failed to open PCM\n"); return 0; } + pcm_prepare(pcm); unsigned int frame_size = pcm_frames_to_bytes(pcm, 1); unsigned int frames_per_sec = pcm_get_rate(pcm); diff --git a/examples/pcm-writei.c b/examples/pcm-writei.c index 19eafac..46b1a3d 100644 --- a/examples/pcm-writei.c +++ b/examples/pcm-writei.c @@ -70,6 +70,7 @@ static int write_frames(const void * frames, size_t byte_count){ fprintf(stderr, "failed to open PCM\n"); return -1; } + pcm_prepare(pcm); unsigned int frame_count = pcm_bytes_to_frames(pcm, byte_count); diff --git a/src/pcm.c b/src/pcm.c index 169d982..8678919 100644 --- a/src/pcm.c +++ b/src/pcm.c @@ -1101,10 +1101,6 @@ struct pcm *pcm_open(unsigned int card, unsigned int device, } #endif - /* prepare here so the user does not need to do this later */ - if (pcm_prepare(pcm)) - goto fail; - pcm->xruns = 0; return pcm; 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 { diff --git a/tests/src/pcm_loopback_test.cc b/tests/src/pcm_loopback_test.cc index 6a3ffb8..9685364 100644 --- a/tests/src/pcm_loopback_test.cc +++ b/tests/src/pcm_loopback_test.cc @@ -160,6 +160,7 @@ TEST(PcmLoopbackTest, LoopbackS16le) { }; pcm *pcm_in = pcm_open(kLoopbackCard, kLoopbackCaptureDevice, PCM_IN, &kInConfig); ASSERT_TRUE(pcm_is_ready(pcm_in)); + pcm_prepare(pcm_in); static constexpr pcm_config kOutConfig = { .channels = kDefaultChannels, @@ -174,6 +175,7 @@ TEST(PcmLoopbackTest, LoopbackS16le) { }; pcm *pcm_out = pcm_open(kLoopbackCard, kLoopbackPlaybackDevice, PCM_OUT, &kOutConfig); ASSERT_TRUE(pcm_is_ready(pcm_out)); + pcm_prepare(pcm_out); ASSERT_EQ(pcm_link(pcm_in, pcm_out), 0); diff --git a/tests/src/pcm_out_test.cc b/tests/src/pcm_out_test.cc index cbc6983..ca984a6 100644 --- a/tests/src/pcm_out_test.cc +++ b/tests/src/pcm_out_test.cc @@ -47,6 +47,7 @@ class PcmOutTest : public ::testing::Test { pcm_object = pcm_open(kLoopbackCard, kLoopbackPlaybackDevice, PCM_OUT, &kDefaultConfig); ASSERT_NE(pcm_object, nullptr); ASSERT_TRUE(pcm_is_ready(pcm_object)); + pcm_prepare(pcm_object); } virtual void TearDown() override { @@ -176,6 +177,7 @@ class PcmOutMmapTest : public PcmOutTest { &kDefaultConfig); ASSERT_NE(pcm_object, nullptr); ASSERT_TRUE(pcm_is_ready(pcm_object)); + pcm_prepare(pcm_object); } virtual void TearDown() override { diff --git a/utils/tinycap.c b/utils/tinycap.c index 7d4b8a4..e3aa9df 100644 --- a/utils/tinycap.c +++ b/utils/tinycap.c @@ -231,6 +231,7 @@ unsigned int capture_sample(FILE *file, unsigned int card, unsigned int device, pcm_get_error(pcm)); return 0; } + pcm_prepare(pcm); size = pcm_frames_to_bytes(pcm, pcm_get_buffer_size(pcm)); buffer = malloc(size); diff --git a/utils/tinyplay.c b/utils/tinyplay.c index 2689158..482ad24 100644 --- a/utils/tinyplay.c +++ b/utils/tinyplay.c @@ -192,6 +192,7 @@ int ctx_init(struct ctx* ctx, const struct cmd *cmd) pcm_close(ctx->pcm); return -1; } + pcm_prepare(ctx->pcm); return 0; } -- cgit v1.2.3 From b618ec79a1fde67594d7361c5fdc07d74a464951 Mon Sep 17 00:00:00 2001 From: dvdli Date: Tue, 12 Jan 2021 18:09:46 +0800 Subject: fix integer character ascii range --- utils/tinymix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/tinymix.c b/utils/tinymix.c index 5c0378c..e272ade 100644 --- a/utils/tinymix.c +++ b/utils/tinymix.c @@ -370,7 +370,7 @@ fail: static int is_int(const char *value) { - return value[0] >= '0' || value[0] <= '9'; + return value[0] >= '0' && value[0] <= '9'; } struct parsed_int -- 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 --- examples/pcm-readi.c | 1 - examples/pcm-writei.c | 1 - src/pcm.c | 4 ++++ tests/src/pcm_in_test.cc | 2 +- tests/src/pcm_loopback_test.cc | 2 -- tests/src/pcm_out_test.cc | 2 -- utils/tinycap.c | 1 - utils/tinyplay.c | 1 - 8 files changed, 5 insertions(+), 9 deletions(-) diff --git a/examples/pcm-readi.c b/examples/pcm-readi.c index dc18b63..8722b41 100644 --- a/examples/pcm-readi.c +++ b/examples/pcm-readi.c @@ -29,7 +29,6 @@ static size_t read_frames(void **frames) fprintf(stderr, "failed to open PCM\n"); return 0; } - pcm_prepare(pcm); unsigned int frame_size = pcm_frames_to_bytes(pcm, 1); unsigned int frames_per_sec = pcm_get_rate(pcm); diff --git a/examples/pcm-writei.c b/examples/pcm-writei.c index 46b1a3d..19eafac 100644 --- a/examples/pcm-writei.c +++ b/examples/pcm-writei.c @@ -70,7 +70,6 @@ static int write_frames(const void * frames, size_t byte_count){ fprintf(stderr, "failed to open PCM\n"); return -1; } - pcm_prepare(pcm); unsigned int frame_count = pcm_bytes_to_frames(pcm, byte_count); diff --git a/src/pcm.c b/src/pcm.c index 8678919..3d7da0c 100644 --- a/src/pcm.c +++ b/src/pcm.c @@ -1637,6 +1637,10 @@ static int pcm_generic_transfer(struct pcm *pcm, void *data, if (frames > INT_MAX) return -EINVAL; + if (pcm_state(pcm) == PCM_STATE_SETUP && pcm_prepare(pcm) != 0) { + return -1; + } + again: if (pcm->flags & PCM_MMAP) 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); diff --git a/tests/src/pcm_loopback_test.cc b/tests/src/pcm_loopback_test.cc index 9685364..6a3ffb8 100644 --- a/tests/src/pcm_loopback_test.cc +++ b/tests/src/pcm_loopback_test.cc @@ -160,7 +160,6 @@ TEST(PcmLoopbackTest, LoopbackS16le) { }; pcm *pcm_in = pcm_open(kLoopbackCard, kLoopbackCaptureDevice, PCM_IN, &kInConfig); ASSERT_TRUE(pcm_is_ready(pcm_in)); - pcm_prepare(pcm_in); static constexpr pcm_config kOutConfig = { .channels = kDefaultChannels, @@ -175,7 +174,6 @@ TEST(PcmLoopbackTest, LoopbackS16le) { }; pcm *pcm_out = pcm_open(kLoopbackCard, kLoopbackPlaybackDevice, PCM_OUT, &kOutConfig); ASSERT_TRUE(pcm_is_ready(pcm_out)); - pcm_prepare(pcm_out); ASSERT_EQ(pcm_link(pcm_in, pcm_out), 0); diff --git a/tests/src/pcm_out_test.cc b/tests/src/pcm_out_test.cc index ca984a6..cbc6983 100644 --- a/tests/src/pcm_out_test.cc +++ b/tests/src/pcm_out_test.cc @@ -47,7 +47,6 @@ class PcmOutTest : public ::testing::Test { pcm_object = pcm_open(kLoopbackCard, kLoopbackPlaybackDevice, PCM_OUT, &kDefaultConfig); ASSERT_NE(pcm_object, nullptr); ASSERT_TRUE(pcm_is_ready(pcm_object)); - pcm_prepare(pcm_object); } virtual void TearDown() override { @@ -177,7 +176,6 @@ class PcmOutMmapTest : public PcmOutTest { &kDefaultConfig); ASSERT_NE(pcm_object, nullptr); ASSERT_TRUE(pcm_is_ready(pcm_object)); - pcm_prepare(pcm_object); } virtual void TearDown() override { diff --git a/utils/tinycap.c b/utils/tinycap.c index e3aa9df..7d4b8a4 100644 --- a/utils/tinycap.c +++ b/utils/tinycap.c @@ -231,7 +231,6 @@ unsigned int capture_sample(FILE *file, unsigned int card, unsigned int device, pcm_get_error(pcm)); return 0; } - pcm_prepare(pcm); size = pcm_frames_to_bytes(pcm, pcm_get_buffer_size(pcm)); buffer = malloc(size); diff --git a/utils/tinyplay.c b/utils/tinyplay.c index 482ad24..2689158 100644 --- a/utils/tinyplay.c +++ b/utils/tinyplay.c @@ -192,7 +192,6 @@ int ctx_init(struct ctx* ctx, const struct cmd *cmd) pcm_close(ctx->pcm); return -1; } - pcm_prepare(ctx->pcm); return 0; } -- cgit v1.2.3 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 --- include/tinyalsa/pcm.h | 4 ++-- src/pcm.c | 8 ++++---- tests/src/pcm_out_test.cc | 6 +++--- utils/tinyplay.c | 3 +++ 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/include/tinyalsa/pcm.h b/include/tinyalsa/pcm.h index 6569146..b40550c 100644 --- a/include/tinyalsa/pcm.h +++ b/include/tinyalsa/pcm.h @@ -335,9 +335,9 @@ int pcm_write(struct pcm *pcm, const void *data, unsigned int count) TINYALSA_DE int pcm_read(struct pcm *pcm, void *data, unsigned int count) TINYALSA_DEPRECATED; -int pcm_mmap_write(struct pcm *pcm, const void *data, unsigned int count); +int pcm_mmap_write(struct pcm *pcm, const void *data, unsigned int count) TINYALSA_DEPRECATED; -int pcm_mmap_read(struct pcm *pcm, void *data, unsigned int count); +int pcm_mmap_read(struct pcm *pcm, void *data, unsigned int count) TINYALSA_DEPRECATED; int pcm_mmap_begin(struct pcm *pcm, void **areas, unsigned int *offset, unsigned int *frames); diff --git a/src/pcm.c b/src/pcm.c index 3d7da0c..10e477b 100644 --- a/src/pcm.c +++ b/src/pcm.c @@ -1547,10 +1547,10 @@ int pcm_mmap_transfer(struct pcm *pcm, void *buffer, unsigned int frames) int pcm_mmap_write(struct pcm *pcm, const void *data, unsigned int count) { if ((~pcm->flags) & (PCM_OUT | PCM_MMAP)) - return -ENOSYS; + return -EINVAL; unsigned int frames = pcm_bytes_to_frames(pcm, count); - int res = pcm_mmap_transfer(pcm, (void *) data, frames); + int res = pcm_writei(pcm, (void *) data, frames); if (res < 0) { return res; @@ -1562,10 +1562,10 @@ int pcm_mmap_write(struct pcm *pcm, const void *data, unsigned int count) int pcm_mmap_read(struct pcm *pcm, void *data, unsigned int count) { if ((~pcm->flags) & (PCM_IN | PCM_MMAP)) - return -ENOSYS; + return -EINVAL; unsigned int frames = pcm_bytes_to_frames(pcm, count); - int res = pcm_mmap_transfer(pcm, data, frames); + int res = pcm_readi(pcm, data, frames); if (res < 0) { return res; 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); diff --git a/utils/tinyplay.c b/utils/tinyplay.c index 2689158..4c7ccf6 100644 --- a/utils/tinyplay.c +++ b/utils/tinyplay.c @@ -303,6 +303,9 @@ int main(int argc, char **argv) case 'i': cmd.filetype = opts.optarg; break; + case 'M': + cmd.flags |= PCM_MMAP; + break; case 'h': print_usage(argv[0]); return EXIT_SUCCESS; -- cgit v1.2.3 From 1fd610f036a894bc5bcef84d1c1ccd40c45950d8 Mon Sep 17 00:00:00 2001 From: dvdli Date: Thu, 28 Jan 2021 17:46:05 +0800 Subject: fix test case to match the API --- tests/src/mixer_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/mixer_test.cc b/tests/src/mixer_test.cc index 717269c..903fb8f 100644 --- a/tests/src/mixer_test.cc +++ b/tests/src/mixer_test.cc @@ -288,7 +288,7 @@ TEST_P(MixerControlsTest, Event) { EXPECT_EQ(mixer_wait_event(mixer_object, 1000), 1); - EXPECT_EQ(mixer_consume_event(mixer_object), 0); + EXPECT_EQ(mixer_consume_event(mixer_object), 1); thread.join(); ASSERT_EQ(mixer_subscribe_events(mixer_object, 0), 0); -- cgit v1.2.3 From 5e65c16b305b9e4a3ca858cfb1b7a188db0d5242 Mon Sep 17 00:00:00 2001 From: dvdli Date: Fri, 29 Jan 2021 14:30:00 +0800 Subject: upgrade Travis CI dist to bionic --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 28667cb..4186666 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ os: linux -dist: xenial +dist: bionic sudo: false language: c compiler: -- cgit v1.2.3