Update of /cvsroot/alsa/alsa-kernel/core/oss In directory sc8-pr-cvs1:/tmp/cvs-serv28692
Modified Files: pcm_oss.c Log Message: - fixed the bytes field of GETxPTR ioctl in the mmap mode. - fixed the bytes field of GETxSPACE ioctl. - don't count the negative delay values. Index: pcm_oss.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/core/oss/pcm_oss.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -r1.59 -r1.60 --- pcm_oss.c 28 Nov 2003 15:51:56 -0000 1.59 +++ pcm_oss.c 1 Dec 2003 13:15:00 -0000 1.60 @@ -1448,7 +1448,7 @@ } if (stream == SNDRV_PCM_STREAM_PLAYBACK) { err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, &delay); - if (err == -EPIPE || err == -ESTRPIPE) { + if (err == -EPIPE || err == -ESTRPIPE || (! err && delay < 0)) { err = 0; delay = 0; fixup = 0; @@ -1461,11 +1461,6 @@ } if (err < 0) return err; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { - info.bytes = runtime->oss.bytes - snd_pcm_oss_bytes(substream, delay); - } else { - info.bytes = runtime->oss.bytes + snd_pcm_oss_bytes(substream, delay); - } info.ptr = snd_pcm_oss_bytes(substream, runtime->status->hw_ptr % runtime->buffer_size); if (atomic_read(&runtime->mmap_count)) { snd_pcm_sframes_t n; @@ -1476,9 +1471,14 @@ runtime->oss.prev_hw_ptr_interrupt = runtime->hw_ptr_interrupt; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) snd_pcm_oss_simulate_fill(substream); + info.bytes = snd_pcm_oss_bytes(substream, runtime->status->hw_ptr); } else { delay = snd_pcm_oss_bytes(substream, delay) + fixup; info.blocks = delay / runtime->oss.period_bytes; + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + info.bytes = runtime->oss.bytes - snd_pcm_oss_bytes(substream, delay); + else + info.bytes = runtime->oss.bytes + snd_pcm_oss_bytes(substream, delay); } if (copy_to_user(_info, &info, sizeof(info))) return -EFAULT; @@ -1509,7 +1509,7 @@ info.fragstotal = runtime->periods; if (runtime->oss.prepare) { if (stream == SNDRV_PCM_STREAM_PLAYBACK) { - info.bytes = runtime->oss.period_bytes * runtime->periods; + info.bytes = runtime->oss.period_bytes * runtime->oss.periods; info.fragments = runtime->oss.periods; } else { info.bytes = 0; @@ -1518,7 +1518,7 @@ } else { if (stream == SNDRV_PCM_STREAM_PLAYBACK) { err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, &avail); - if (err == -EPIPE || err == -ESTRPIPE) { + if (err == -EPIPE || err == -ESTRPIPE || (! err && avail < 0)) { avail = runtime->buffer_size; err = 0; fixup = 0; ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Alsa-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-cvslog