Completed renaming drain->stop, flush->drain (PCM). Done renaming drain->drop, flush->drain (rawmidi and seq). Removed wrong module usage count inc/dec from mmap

This commit is contained in:
Abramo Bagnara 2000-09-29 20:49:18 +00:00
parent 7088f19233
commit 2ea3fd4bb3
22 changed files with 86 additions and 86 deletions

View file

@ -191,10 +191,10 @@ int snd_pcm_stop(snd_pcm_t *pcm)
return pcm->fast_ops->stop(pcm->fast_op_arg);
}
int snd_pcm_flush(snd_pcm_t *pcm)
int snd_pcm_drain(snd_pcm_t *pcm)
{
assert(pcm);
return pcm->fast_ops->flush(pcm->fast_op_arg);
return pcm->fast_ops->drain(pcm->fast_op_arg);
}
int snd_pcm_pause(snd_pcm_t *pcm, int enable)
@ -411,7 +411,7 @@ static assoc_t starts[] = { START(EXPLICIT), START(DATA), END };
static assoc_t readys[] = { READY(FRAGMENT), READY(ASAP), END };
static assoc_t xfers[] = { XFER(INTERLEAVED), XFER(NONINTERLEAVED), END };
static assoc_t mmaps[] = { MMAP(INTERLEAVED), MMAP(NONINTERLEAVED), END };
static assoc_t xrun_acts[] = { XRUN_ACT(FLUSH), XRUN_ACT(DRAIN), END };
static assoc_t xrun_acts[] = { XRUN_ACT(STOP), XRUN_ACT(DROP), END };
static assoc_t onoff[] = { {0, "OFF", NULL}, {1, "ON", NULL}, {-1, "ON", NULL}, END };
int snd_pcm_dump_setup(snd_pcm_t *pcm, FILE *fp)

View file

@ -362,12 +362,12 @@ static int snd_pcm_client_shm_stop(snd_pcm_t *pcm)
return ctrl->result;
}
static int snd_pcm_client_shm_flush(snd_pcm_t *pcm)
static int snd_pcm_client_shm_drain(snd_pcm_t *pcm)
{
snd_pcm_client_t *client = pcm->private;
snd_pcm_client_shm_t *ctrl = client->u.shm.ctrl;
int err;
ctrl->cmd = SND_PCM_IOCTL_FLUSH;
ctrl->cmd = SND_PCM_IOCTL_DRAIN;
err = snd_pcm_client_shm_action(pcm);
if (err < 0)
return err;
@ -567,7 +567,7 @@ struct snd_pcm_fast_ops snd_pcm_client_fast_ops = {
prepare: snd_pcm_client_shm_prepare,
start: snd_pcm_client_shm_start,
stop: snd_pcm_client_shm_stop,
flush: snd_pcm_client_shm_flush,
drain: snd_pcm_client_shm_drain,
pause: snd_pcm_client_shm_pause,
rewind: snd_pcm_client_shm_rewind,
writei: snd_pcm_mmap_writei,

View file

@ -110,10 +110,10 @@ static int snd_pcm_file_stop(snd_pcm_t *pcm)
return snd_pcm_stop(file->slave);
}
static int snd_pcm_file_flush(snd_pcm_t *pcm)
static int snd_pcm_file_drain(snd_pcm_t *pcm)
{
snd_pcm_file_t *file = pcm->private;
return snd_pcm_flush(file->slave);
return snd_pcm_drain(file->slave);
}
static int snd_pcm_file_pause(snd_pcm_t *pcm, int enable)
@ -341,7 +341,7 @@ struct snd_pcm_fast_ops snd_pcm_file_fast_ops = {
prepare: snd_pcm_file_prepare,
start: snd_pcm_file_start,
stop: snd_pcm_file_stop,
flush: snd_pcm_file_flush,
drain: snd_pcm_file_drain,
pause: snd_pcm_file_pause,
rewind: snd_pcm_file_rewind,
writei: snd_pcm_file_writei,

View file

@ -207,11 +207,11 @@ static int snd_pcm_hw_stop(snd_pcm_t *pcm)
return 0;
}
static int snd_pcm_hw_flush(snd_pcm_t *pcm)
static int snd_pcm_hw_drain(snd_pcm_t *pcm)
{
snd_pcm_hw_t *hw = pcm->private;
int fd = hw->fd;
if (ioctl(fd, SND_PCM_IOCTL_FLUSH) < 0)
if (ioctl(fd, SND_PCM_IOCTL_DRAIN) < 0)
return -errno;
return 0;
}
@ -454,7 +454,7 @@ struct snd_pcm_fast_ops snd_pcm_hw_fast_ops = {
prepare: snd_pcm_hw_prepare,
start: snd_pcm_hw_start,
stop: snd_pcm_hw_stop,
flush: snd_pcm_hw_flush,
drain: snd_pcm_hw_drain,
pause: snd_pcm_hw_pause,
rewind: snd_pcm_hw_rewind,
writei: snd_pcm_hw_writei,

View file

@ -50,7 +50,7 @@ struct snd_pcm_fast_ops {
int (*prepare)(snd_pcm_t *pcm);
int (*start)(snd_pcm_t *pcm);
int (*stop)(snd_pcm_t *pcm);
int (*flush)(snd_pcm_t *pcm);
int (*drain)(snd_pcm_t *pcm);
int (*pause)(snd_pcm_t *pcm, int enable);
int (*state)(snd_pcm_t *pcm);
int (*delay)(snd_pcm_t *pcm, ssize_t *delayp);

View file

@ -49,7 +49,7 @@ static int snd_pcm_mmap_capture_ready(snd_pcm_t *pcm)
int ret = 0;
if (pcm->mmap_status->state == SND_PCM_STATE_XRUN) {
ret = -EPIPE;
if (pcm->setup.xrun_act == SND_PCM_XRUN_ACT_DRAIN)
if (pcm->setup.xrun_act == SND_PCM_XRUN_ACT_DROP)
return -EPIPE;
}
if (snd_pcm_mmap_capture_avail(pcm) >= pcm->setup.avail_min)

View file

@ -259,10 +259,10 @@ static int snd_pcm_multi_stop(snd_pcm_t *pcm)
return snd_pcm_stop(multi->slaves[0].handle);
}
static int snd_pcm_multi_flush(snd_pcm_t *pcm)
static int snd_pcm_multi_drain(snd_pcm_t *pcm)
{
snd_pcm_multi_t *multi = pcm->private;
return snd_pcm_flush(multi->slaves[0].handle);
return snd_pcm_drain(multi->slaves[0].handle);
}
static int snd_pcm_multi_pause(snd_pcm_t *pcm, int enable)
@ -521,7 +521,7 @@ struct snd_pcm_fast_ops snd_pcm_multi_fast_ops = {
prepare: snd_pcm_multi_prepare,
start: snd_pcm_multi_start,
stop: snd_pcm_multi_stop,
flush: snd_pcm_multi_flush,
drain: snd_pcm_multi_drain,
pause: snd_pcm_multi_pause,
writei: snd_pcm_mmap_writei,
writen: snd_pcm_mmap_writen,

View file

@ -142,10 +142,10 @@ int snd_pcm_plugin_stop(snd_pcm_t *pcm)
return snd_pcm_stop(plugin->slave);
}
int snd_pcm_plugin_flush(snd_pcm_t *pcm)
int snd_pcm_plugin_drain(snd_pcm_t *pcm)
{
snd_pcm_plugin_t *plugin = pcm->private;
return snd_pcm_flush(plugin->slave);
return snd_pcm_drain(plugin->slave);
}
int snd_pcm_plugin_pause(snd_pcm_t *pcm, int enable)
@ -397,7 +397,7 @@ struct snd_pcm_fast_ops snd_pcm_plugin_fast_ops = {
prepare: snd_pcm_plugin_prepare,
start: snd_pcm_plugin_start,
stop: snd_pcm_plugin_stop,
flush: snd_pcm_plugin_flush,
drain: snd_pcm_plugin_drain,
pause: snd_pcm_plugin_pause,
rewind: snd_pcm_plugin_rewind,
writei: snd_pcm_plugin_writei,

View file

@ -42,7 +42,7 @@ int snd_pcm_plugin_delay(snd_pcm_t *pcm, ssize_t *delayp);
int snd_pcm_plugin_prepare(snd_pcm_t *pcm);
int snd_pcm_plugin_start(snd_pcm_t *pcm);
int snd_pcm_plugin_stop(snd_pcm_t *pcm);
int snd_pcm_plugin_flush(snd_pcm_t *pcm);
int snd_pcm_plugin_drain(snd_pcm_t *pcm);
int snd_pcm_plugin_pause(snd_pcm_t *pcm, int enable);
ssize_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, size_t frames);
ssize_t snd_pcm_plugin_writei(snd_pcm_t *pcm, const void *buffer, size_t size);

View file

@ -155,35 +155,35 @@ int snd_rawmidi_stream_status(snd_rawmidi_t *rmidi, snd_rawmidi_status_t * statu
return 0;
}
int snd_rawmidi_output_drain(snd_rawmidi_t *rmidi)
int snd_rawmidi_output_drop(snd_rawmidi_t *rmidi)
{
int str = SND_RAWMIDI_STREAM_OUTPUT;
if (!rmidi)
return -EINVAL;
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_STREAM_DROP, &str) < 0)
return -errno;
return 0;
}
int snd_rawmidi_stream_drain(snd_rawmidi_t *rmidi, int str)
{
if (!rmidi)
return -EINVAL;
if (str < 0 || str > 1)
return -EINVAL;
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_STREAM_DRAIN, &str) < 0)
return -errno;
return 0;
}
int snd_rawmidi_stream_flush(snd_rawmidi_t *rmidi, int str)
int snd_rawmidi_output_drain(snd_rawmidi_t *rmidi)
{
if (!rmidi)
return -EINVAL;
if (str < 0 || str > 1)
return -EINVAL;
if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_STREAM_FLUSH, &str) < 0)
return -errno;
return 0;
return snd_rawmidi_stream_drain(rmidi, SND_RAWMIDI_STREAM_OUTPUT);
}
int snd_rawmidi_output_flush(snd_rawmidi_t *rmidi)
int snd_rawmidi_input_drain(snd_rawmidi_t *rmidi)
{
return snd_rawmidi_stream_flush(rmidi, SND_RAWMIDI_STREAM_OUTPUT);
}
int snd_rawmidi_input_flush(snd_rawmidi_t *rmidi)
{
return snd_rawmidi_stream_flush(rmidi, SND_RAWMIDI_STREAM_INPUT);
return snd_rawmidi_stream_drain(rmidi, SND_RAWMIDI_STREAM_INPUT);
}
ssize_t snd_rawmidi_write(snd_rawmidi_t *rmidi, const void *buffer, size_t size)

View file

@ -189,7 +189,7 @@ int snd_seq_resize_output_buffer(snd_seq_t *seq, size_t size)
return -EINVAL;
if (size < sizeof(snd_seq_event_t))
return -EINVAL;
snd_seq_drain_output(seq);
snd_seq_drop_output(seq);
if (size != seq->obufsize) {
char *newbuf;
newbuf = calloc(1, size);
@ -211,7 +211,7 @@ int snd_seq_resize_input_buffer(snd_seq_t *seq, size_t size)
return -EINVAL;
if (size < sizeof(snd_seq_event_t))
return -EINVAL;
snd_seq_drain_input(seq);
snd_seq_drop_input(seq);
size = (size + sizeof(snd_seq_event_t) - 1) / sizeof(snd_seq_event_t);
if (size != seq->ibufsize) {
snd_seq_event_t *newbuf;
@ -711,7 +711,7 @@ int snd_seq_event_output(snd_seq_t *seq, snd_seq_event_t *ev)
result = snd_seq_event_output_buffer(seq, ev);
if (result == -EAGAIN) {
result = snd_seq_flush_output(seq);
result = snd_seq_drain_output(seq);
if (result < 0)
return result;
return snd_seq_event_output_buffer(seq, ev);
@ -803,9 +803,9 @@ int snd_seq_event_output_pending(snd_seq_t *seq)
}
/*
* flush output buffer to sequencer
* drain output buffer to sequencer
*/
int snd_seq_flush_output(snd_seq_t *seq)
int snd_seq_drain_output(snd_seq_t *seq)
{
int result;
@ -951,7 +951,7 @@ int snd_seq_event_input_pending(snd_seq_t *seq, int fetch_sequencer)
/*
* clear output buffer
*/
int snd_seq_drain_output_buffer(snd_seq_t *seq)
int snd_seq_drop_output_buffer(snd_seq_t *seq)
{
if (!seq)
return -EINVAL;
@ -962,7 +962,7 @@ int snd_seq_drain_output_buffer(snd_seq_t *seq)
/*
* clear input buffer
*/
int snd_seq_drain_input_buffer(snd_seq_t *seq)
int snd_seq_drop_input_buffer(snd_seq_t *seq)
{
if (!seq)
return -EINVAL;
@ -974,7 +974,7 @@ int snd_seq_drain_input_buffer(snd_seq_t *seq)
/*
* clear output buffer and remove events in sequencer queue
*/
int snd_seq_drain_output(snd_seq_t *seq)
int snd_seq_drop_output(snd_seq_t *seq)
{
snd_seq_remove_events_t rminfo;
@ -992,7 +992,7 @@ int snd_seq_drain_output(snd_seq_t *seq)
/*
* clear input buffer and and remove events in sequencer queue
*/
int snd_seq_drain_input(snd_seq_t *seq)
int snd_seq_drop_input(snd_seq_t *seq)
{
snd_seq_remove_events_t rminfo;
@ -1095,7 +1095,7 @@ int snd_seq_remove_events(snd_seq_t *seq, snd_seq_remove_events_t *rmp)
* in the library.
*/
if (rmp->remove_mode == 0)
snd_seq_drain_input_buffer(seq);
snd_seq_drop_input_buffer(seq);
/* other modes are not supported yet */
}
@ -1106,7 +1106,7 @@ int snd_seq_remove_events(snd_seq_t *seq, snd_seq_remove_events_t *rmp)
*/
if (rmp->remove_mode == 0) {
/* The simple case - remove all */
snd_seq_drain_output_buffer(seq);
snd_seq_drop_output_buffer(seq);
} else {
char *ep;
size_t len;