aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Biehl Pasquali <pasqualirb@gmail.com>2018-12-19 14:05:05 -0200
committerRicardo Biehl Pasquali <pasqualirb@gmail.com>2019-01-08 16:48:19 -0200
commit297d24b7eb264f1fad464c15e4298f714452877e (patch)
treee9571870b901ba5dd8903797a26b246c6b620a95
parent4ee09a97af1f770241e24e4d395e28c1ad1343c5 (diff)
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 <pasqualirb@gmail.com>
-rw-r--r--src/pcm.c7
1 files changed, 0 insertions, 7 deletions
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;
}