diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-09-08 13:48:34 +0200 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-09-12 10:47:37 +0200 |
commit | 10f69f9e42833b82288882d10901dc86adc3e473 (patch) | |
tree | ed2767c07158e36cf2eba4127a9d986428b2e89a /sound/core/oss/pcm_oss.c | |
parent | f328385309f310626751c54f694641459e2d4582 (diff) |
[ALSA] pcm-oss - Add bugg-yptr option
Documentation,ALSA<-OSS emulation
Added 'buggy-ptr' proc option to switch the behavior of GETOPTR ioctl.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/oss/pcm_oss.c')
-rw-r--r-- | sound/core/oss/pcm_oss.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 1e606399d74..a038fd8a53f 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -1543,7 +1543,11 @@ static int snd_pcm_oss_get_ptr(snd_pcm_oss_file_t *pcm_oss_file, int stream, str } else { delay = snd_pcm_oss_bytes(substream, delay); if (stream == SNDRV_PCM_STREAM_PLAYBACK) { - info.blocks = (runtime->oss.buffer_bytes - delay - fixup) / runtime->oss.period_bytes; + snd_pcm_oss_setup_t *setup = substream->oss.setup; + if (setup && setup->buggyptr) + info.blocks = (runtime->oss.buffer_bytes - delay - fixup) / runtime->oss.period_bytes; + else + info.blocks = (delay + fixup) / runtime->oss.period_bytes; info.bytes = (runtime->oss.bytes - delay) & INT_MAX; } else { delay += fixup; @@ -2350,6 +2354,8 @@ static void snd_pcm_oss_proc_write(snd_info_entry_t *entry, template.partialfrag = 1; } else if (!strcmp(str, "no-silence")) { template.nosilence = 1; + } else if (!strcmp(str, "buggy-ptr")) { + template.buggyptr = 1; } } while (*str); if (setup == NULL) { |