diff options
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/oss/pcm_oss.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 468fca8894d9..203470df5857 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c | |||
@@ -1539,10 +1539,13 @@ static int snd_pcm_oss_get_ptr(snd_pcm_oss_file_t *pcm_oss_file, int stream, str | |||
1539 | } else { | 1539 | } else { |
1540 | delay = snd_pcm_oss_bytes(substream, delay) + fixup; | 1540 | delay = snd_pcm_oss_bytes(substream, delay) + fixup; |
1541 | info.blocks = delay / runtime->oss.period_bytes; | 1541 | info.blocks = delay / runtime->oss.period_bytes; |
1542 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) | 1542 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) { |
1543 | if (runtime->oss.bytes == 0) | ||
1544 | delay = 0; | ||
1543 | info.bytes = (runtime->oss.bytes - delay) & INT_MAX; | 1545 | info.bytes = (runtime->oss.bytes - delay) & INT_MAX; |
1544 | else | 1546 | } else { |
1545 | info.bytes = (runtime->oss.bytes + delay) & INT_MAX; | 1547 | info.bytes = (runtime->oss.bytes + delay) & INT_MAX; |
1548 | } | ||
1546 | } | 1549 | } |
1547 | if (copy_to_user(_info, &info, sizeof(info))) | 1550 | if (copy_to_user(_info, &info, sizeof(info))) |
1548 | return -EFAULT; | 1551 | return -EFAULT; |