[ALSA] Add O_APPEND flag support to PCM
Added O_APPEND flag support to PCM to enable shared substreams among multiple processes. This mechanism is used by dmix and dsnoop plugins. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
committed by
Jaroslav Kysela
parent
f001c3acf6
commit
0df63e44c3
@@ -1782,7 +1782,7 @@ snd_pcm_sframes_t snd_pcm_lib_write(struct snd_pcm_substream *substream, const v
|
||||
if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
|
||||
return -EBADFD;
|
||||
|
||||
nonblock = !!(substream->ffile->f_flags & O_NONBLOCK);
|
||||
nonblock = !!(substream->f_flags & O_NONBLOCK);
|
||||
|
||||
if (runtime->access != SNDRV_PCM_ACCESS_RW_INTERLEAVED &&
|
||||
runtime->channels > 1)
|
||||
@@ -1847,7 +1847,7 @@ snd_pcm_sframes_t snd_pcm_lib_writev(struct snd_pcm_substream *substream,
|
||||
if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
|
||||
return -EBADFD;
|
||||
|
||||
nonblock = !!(substream->ffile->f_flags & O_NONBLOCK);
|
||||
nonblock = !!(substream->f_flags & O_NONBLOCK);
|
||||
|
||||
if (runtime->access != SNDRV_PCM_ACCESS_RW_NONINTERLEAVED)
|
||||
return -EINVAL;
|
||||
@@ -2059,7 +2059,7 @@ snd_pcm_sframes_t snd_pcm_lib_read(struct snd_pcm_substream *substream, void __u
|
||||
if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
|
||||
return -EBADFD;
|
||||
|
||||
nonblock = !!(substream->ffile->f_flags & O_NONBLOCK);
|
||||
nonblock = !!(substream->f_flags & O_NONBLOCK);
|
||||
if (runtime->access != SNDRV_PCM_ACCESS_RW_INTERLEAVED)
|
||||
return -EINVAL;
|
||||
return snd_pcm_lib_read1(substream, (unsigned long)buf, size, nonblock, snd_pcm_lib_read_transfer);
|
||||
@@ -2118,7 +2118,7 @@ snd_pcm_sframes_t snd_pcm_lib_readv(struct snd_pcm_substream *substream,
|
||||
if (runtime->status->state == SNDRV_PCM_STATE_OPEN)
|
||||
return -EBADFD;
|
||||
|
||||
nonblock = !!(substream->ffile->f_flags & O_NONBLOCK);
|
||||
nonblock = !!(substream->f_flags & O_NONBLOCK);
|
||||
if (runtime->access != SNDRV_PCM_ACCESS_RW_NONINTERLEAVED)
|
||||
return -EINVAL;
|
||||
return snd_pcm_lib_read1(substream, (unsigned long)bufs, frames, nonblock, snd_pcm_lib_readv_transfer);
|
||||
|
Reference in New Issue
Block a user