Skip to content

Commit

Permalink
[ALSA] OSS PCM emulation - The 2nd final fix for SNDCTL_DSP_GETOPTR p…
Browse files Browse the repository at this point in the history
…roblem

ALSA<-OSS emulation
The problem was negative/wrong result (info.bytes) in a specific condition at
playback startup.

Signed-off-by: Jaroslav Kysela <perex@suse.cz>
  • Loading branch information
Jaroslav Kysela committed Jun 22, 2005
1 parent 98c7f21 commit 5ac0fab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sound/core/oss/pcm_oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1537,13 +1537,13 @@ static int snd_pcm_oss_get_ptr(snd_pcm_oss_file_t *pcm_oss_file, int stream, str
snd_pcm_oss_simulate_fill(substream, delay);
info.bytes = snd_pcm_oss_bytes(substream, runtime->status->hw_ptr) & INT_MAX;
} else {
delay = snd_pcm_oss_bytes(substream, delay) + fixup;
info.blocks = delay / runtime->oss.period_bytes;
delay = snd_pcm_oss_bytes(substream, delay);
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
if (runtime->oss.bytes == 0)
delay = 0;
info.blocks = (runtime->oss.buffer_bytes - delay - fixup) / runtime->oss.period_bytes;
info.bytes = (runtime->oss.bytes - delay) & INT_MAX;
} else {
delay += fixup;
info.blocks = delay / runtime->oss.period_bytes;
info.bytes = (runtime->oss.bytes + delay) & INT_MAX;
}
}
Expand Down

0 comments on commit 5ac0fab

Please sign in to comment.