mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
alsa: set offset to 0 for playback streams
This commit is contained in:
parent
5ea1fd3e7d
commit
55c5e48578
1 changed files with 16 additions and 12 deletions
|
|
@ -201,22 +201,26 @@ snd_pcm_pipewire_process(snd_pcm_pipewire_t *pw, struct pw_buffer *b, snd_pcm_uf
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pw->blocks == 1) {
|
if (pw->blocks == 1) {
|
||||||
|
if (io->stream == SND_PCM_STREAM_PLAYBACK) {
|
||||||
|
d[0].chunk->size = nframes * pw->stride;
|
||||||
|
d[0].chunk->offset = 0;
|
||||||
|
}
|
||||||
ptr = SPA_MEMBER(d[0].data, d[0].chunk->offset, void);
|
ptr = SPA_MEMBER(d[0].data, d[0].chunk->offset, void);
|
||||||
for (channel = 0; channel < io->channels; channel++) {
|
for (channel = 0; channel < io->channels; channel++) {
|
||||||
pwareas[channel].addr = ptr;
|
pwareas[channel].addr = ptr;
|
||||||
pwareas[channel].first = channel * pw->sample_bits;
|
pwareas[channel].first = channel * pw->sample_bits;
|
||||||
pwareas[channel].step = io->channels * pw->sample_bits;
|
pwareas[channel].step = io->channels * pw->sample_bits;
|
||||||
}
|
}
|
||||||
if (io->stream == SND_PCM_STREAM_PLAYBACK)
|
|
||||||
d[0].chunk->size = nframes * pw->stride;
|
|
||||||
} else {
|
} else {
|
||||||
for (channel = 0; channel < io->channels; channel++) {
|
for (channel = 0; channel < io->channels; channel++) {
|
||||||
|
if (io->stream == SND_PCM_STREAM_PLAYBACK) {
|
||||||
|
d[channel].chunk->size = nframes * pw->stride;
|
||||||
|
d[channel].chunk->offset = 0;
|
||||||
|
}
|
||||||
ptr = SPA_MEMBER(d[channel].data, d[channel].chunk->offset, void);
|
ptr = SPA_MEMBER(d[channel].data, d[channel].chunk->offset, void);
|
||||||
pwareas[channel].addr = ptr;
|
pwareas[channel].addr = ptr;
|
||||||
pwareas[channel].first = 0;
|
pwareas[channel].first = 0;
|
||||||
pwareas[channel].step = pw->sample_bits;
|
pwareas[channel].step = pw->sample_bits;
|
||||||
if (io->stream == SND_PCM_STREAM_PLAYBACK)
|
|
||||||
d[channel].chunk->size = nframes * pw->stride;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue