diff options
-rw-r--r-- | sound/core/oss/pcm_oss.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 5c8c7dff8ede..b753ec661fcf 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c | |||
@@ -1510,16 +1510,19 @@ static ssize_t snd_pcm_oss_read1(struct snd_pcm_substream *substream, char __use | |||
1510 | static int snd_pcm_oss_reset(struct snd_pcm_oss_file *pcm_oss_file) | 1510 | static int snd_pcm_oss_reset(struct snd_pcm_oss_file *pcm_oss_file) |
1511 | { | 1511 | { |
1512 | struct snd_pcm_substream *substream; | 1512 | struct snd_pcm_substream *substream; |
1513 | struct snd_pcm_runtime *runtime; | ||
1514 | int i; | ||
1513 | 1515 | ||
1514 | substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK]; | 1516 | for (i = 0; i < 2; i++) { |
1515 | if (substream != NULL) { | 1517 | substream = pcm_oss_file->streams[i]; |
1516 | snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); | 1518 | if (!substream) |
1517 | substream->runtime->oss.prepare = 1; | 1519 | continue; |
1518 | } | 1520 | runtime = substream->runtime; |
1519 | substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE]; | ||
1520 | if (substream != NULL) { | ||
1521 | snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); | 1521 | snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); |
1522 | substream->runtime->oss.prepare = 1; | 1522 | runtime->oss.prepare = 1; |
1523 | runtime->oss.buffer_used = 0; | ||
1524 | runtime->oss.prev_hw_ptr_period = 0; | ||
1525 | runtime->oss.period_ptr = 0; | ||
1523 | } | 1526 | } |
1524 | return 0; | 1527 | return 0; |
1525 | } | 1528 | } |