if (n > 0) {
snd_pcm_areas_from_buf(pcm, areas, (void*) buffer);
__snd_pcm_lock(pcm);
- snd_pcm_file_add_frames(pcm, areas, 0, n);
+ if (snd_pcm_file_add_frames(pcm, areas, 0, n) < 0) {
+ __snd_pcm_unlock(pcm);
+ return -EPIPE;
+ }
__snd_pcm_unlock(pcm);
}
return n;
if (n > 0) {
snd_pcm_areas_from_bufs(pcm, areas, bufs);
__snd_pcm_lock(pcm);
- snd_pcm_file_add_frames(pcm, areas, 0, n);
+ if (snd_pcm_file_add_frames(pcm, areas, 0, n) < 0) {
+ __snd_pcm_unlock(pcm);
+ return -EPIPE;
+ }
__snd_pcm_unlock(pcm);
}
return n;
snd_pcm_file_areas_read_infile(pcm, areas, 0, frames);
__snd_pcm_lock(pcm);
snd_pcm_file_add_frames(pcm, areas, 0, frames);
+ if (snd_pcm_file_add_frames(pcm, areas, 0, frames) < 0) {
+ __snd_pcm_unlock(pcm);
+ return -EPIPE;
+ }
+
__snd_pcm_unlock(pcm);
return frames;
snd_pcm_areas_from_bufs(pcm, areas, bufs);
snd_pcm_file_areas_read_infile(pcm, areas, 0, frames);
__snd_pcm_lock(pcm);
- snd_pcm_file_add_frames(pcm, areas, 0, frames);
+ if (snd_pcm_file_add_frames(pcm, areas, 0, frames) < 0) {
+ __snd_pcm_unlock(pcm);
+ return -EPIPE;
+ }
+
__snd_pcm_unlock(pcm);
return frames;
if (result >= 0) {
assert(ofs == offset && siz == size);
result = snd_pcm_mmap_commit(file->gen.slave, ofs, siz);
- if (result > 0)
- snd_pcm_file_add_frames(pcm, areas, ofs, result);
+ if (result > 0) {
+ if (snd_pcm_file_add_frames(pcm, areas, ofs, result) < 0)
+ return -EPIPE;
+ }
}
return result;
}