From 297d24b7eb264f1fad464c15e4298f714452877e Mon Sep 17 00:00:00 2001 From: Ricardo Biehl Pasquali Date: Wed, 19 Dec 2018 14:05:05 -0200 Subject: pcm: Remove 'running' variable from pcm structure It is not needed. As the pcm structure is opaque to user it can be safely removed. Signed-off-by: Ricardo Biehl Pasquali --- src/pcm.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/pcm.c') diff --git a/src/pcm.c b/src/pcm.c index 5ba01ca..f49be90 100644 --- a/src/pcm.c +++ b/src/pcm.c @@ -215,8 +215,6 @@ struct pcm { int fd; /** Flags that were passed to @ref pcm_open */ unsigned int flags; - /** Whether the PCM is running or not */ - int running:1; /** The number of underruns that have occured */ int underruns; /** Size of the buffer */ @@ -617,7 +615,6 @@ int pcm_writei(struct pcm *pcm, const void *data, unsigned int frame_count) x.result = 0; for (;;) { if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_WRITEI_FRAMES, &x)) { - pcm->running = 0; if (errno == EPIPE) { /* we failed to make our window -- try to restart if we are * allowed to do so. Otherwise, simply allow the EPIPE error to @@ -665,7 +662,6 @@ int pcm_readi(struct pcm *pcm, void *data, unsigned int frame_count) x.result = 0; for (;;) { if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_READI_FRAMES, &x)) { - pcm->running = 0; if (errno == EPIPE) { /* we failed to make our window -- try to restart */ pcm->underruns++; @@ -923,7 +919,6 @@ int pcm_close(struct pcm *pcm) if (pcm->fd >= 0) close(pcm->fd); - pcm->running = 0; pcm->buffer_size = 0; pcm->fd = -1; free(pcm); @@ -1128,7 +1123,6 @@ int pcm_start(struct pcm *pcm) return oops(pcm, errno, "cannot start channel"); } - pcm->running = 1; return 0; } @@ -1142,7 +1136,6 @@ int pcm_stop(struct pcm *pcm) if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_DROP) < 0) return oops(pcm, errno, "cannot stop channel"); - pcm->running = 0; return 0; } -- cgit v1.2.3