mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
pcm file plugin: handle snd_pcm_mmap_begin() error path in snd_pcm_file_mmap_commit()
This commit is contained in:
parent
8a38461fac
commit
b96f6f4785
1 changed files with 7 additions and 5 deletions
|
|
@ -593,11 +593,13 @@ static snd_pcm_sframes_t snd_pcm_file_mmap_commit(snd_pcm_t *pcm,
|
|||
const snd_pcm_channel_area_t *areas;
|
||||
snd_pcm_sframes_t result;
|
||||
|
||||
snd_pcm_mmap_begin(file->gen.slave, &areas, &ofs, &siz);
|
||||
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);
|
||||
result = snd_pcm_mmap_begin(file->gen.slave, &areas, &ofs, &siz);
|
||||
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);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue