aboutsummaryrefslogtreecommitdiff
path: root/src/pcm.c
diff options
context:
space:
mode:
authorTaylor Holberton <taylorcholberton@gmail.com>2017-04-06 23:06:36 -0700
committerTaylor Holberton <taylorcholberton@gmail.com>2017-04-06 23:06:36 -0700
commit1137fc70bb4ceeea07ba2399b40c4485d2ccc168 (patch)
treec4d9f438c5c66d6845a933b47306a266f3507b51 /src/pcm.c
parentd6e7e04edb3e2049eb9bd6632f06480ba2e7b848 (diff)
removed debug statement
Diffstat (limited to 'src/pcm.c')
-rw-r--r--src/pcm.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/pcm.c b/src/pcm.c
index 75fc85c..62489a6 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -587,13 +587,9 @@ int pcm_readi(struct pcm *pcm, void *data, unsigned int frame_count)
x.frames = frame_count;
x.result = 0;
for (;;) {
- if (!pcm->running) {
- if (pcm_start(pcm) < 0) {
- fprintf(stderr, "start error");
- return -errno;
- }
- }
- if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_READI_FRAMES, &x)) {
+ if ((!pcm->running) && (pcm_start(pcm) < 0))
+ return -errno;
+ else if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_READI_FRAMES, &x)) {
pcm->prepared = 0;
pcm->running = 0;
if (errno == EPIPE) {