mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -05:00
implemented snd_pcm_rewindable() and snd_pcm_forwardable(), removed can_rewind and can_forward
This commit is contained in:
parent
058dde8b7d
commit
c88672d86f
17 changed files with 212 additions and 55 deletions
|
|
@ -1039,6 +1039,17 @@ static snd_pcm_sframes_t _snd_pcm_share_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
|
|||
return n;
|
||||
}
|
||||
|
||||
static snd_pcm_sframes_t snd_pcm_share_rewindable(snd_pcm_t *pcm)
|
||||
{
|
||||
snd_pcm_share_t *share = pcm->private_data;
|
||||
snd_pcm_share_slave_t *slave = share->slave;
|
||||
snd_pcm_sframes_t ret;
|
||||
Pthread_mutex_lock(&slave->mutex);
|
||||
ret = snd_pcm_rewindable(slave->pcm);
|
||||
Pthread_mutex_unlock(&slave->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static snd_pcm_sframes_t snd_pcm_share_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
|
||||
{
|
||||
snd_pcm_share_t *share = pcm->private_data;
|
||||
|
|
@ -1085,6 +1096,17 @@ static snd_pcm_sframes_t _snd_pcm_share_forward(snd_pcm_t *pcm, snd_pcm_uframes_
|
|||
return n;
|
||||
}
|
||||
|
||||
static snd_pcm_sframes_t snd_pcm_share_forwardable(snd_pcm_t *pcm)
|
||||
{
|
||||
snd_pcm_share_t *share = pcm->private_data;
|
||||
snd_pcm_share_slave_t *slave = share->slave;
|
||||
snd_pcm_sframes_t ret;
|
||||
Pthread_mutex_lock(&slave->mutex);
|
||||
ret = snd_pcm_forwardable(slave->pcm);
|
||||
Pthread_mutex_unlock(&slave->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static snd_pcm_sframes_t snd_pcm_share_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
|
||||
{
|
||||
snd_pcm_share_t *share = pcm->private_data;
|
||||
|
|
@ -1316,7 +1338,9 @@ static snd_pcm_fast_ops_t snd_pcm_share_fast_ops = {
|
|||
.writen = snd_pcm_mmap_writen,
|
||||
.readi = snd_pcm_mmap_readi,
|
||||
.readn = snd_pcm_mmap_readn,
|
||||
.rewindable = snd_pcm_share_rewindable,
|
||||
.rewind = snd_pcm_share_rewind,
|
||||
.forwardable = snd_pcm_share_forwardable,
|
||||
.forward = snd_pcm_share_forward,
|
||||
.resume = snd_pcm_share_resume,
|
||||
.avail_update = snd_pcm_share_avail_update,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue