Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148484
b: refs/heads/master
c: 13f040f
h: refs/heads/master
v: v3
  • Loading branch information
Jaroslav Kysela authored and Takashi Iwai committed May 29, 2009
1 parent cfec85c commit afc12d6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c62a01ad6e746fae9c93f51ea67e0abfd8d94b58
refs/heads/master: 13f040f9e55d41e92e485389123654971e03b819
16 changes: 14 additions & 2 deletions trunk/sound/core/pcm_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_ufram

static void xrun(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;

if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE)
snd_pcm_gettime(runtime, (struct timespec *)&runtime->status->tstamp);
snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
if (xrun_debug(substream, 1)) {
snd_printd(KERN_DEBUG "XRUN: pcmC%dD%d%c\n",
Expand All @@ -154,8 +158,6 @@ snd_pcm_update_hw_ptr_pos(struct snd_pcm_substream *substream,
{
snd_pcm_uframes_t pos;

if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE)
snd_pcm_gettime(runtime, (struct timespec *)&runtime->status->tstamp);
pos = substream->ops->pointer(substream);
if (pos == SNDRV_PCM_POS_XRUN)
return pos; /* XRUN */
Expand Down Expand Up @@ -298,10 +300,15 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
runtime->silence_size > 0)
snd_pcm_playback_silence(substream, new_hw_ptr);

if (runtime->status->hw_ptr == new_hw_ptr)
return 0;

runtime->hw_ptr_base = hw_base;
runtime->status->hw_ptr = new_hw_ptr;
runtime->hw_ptr_jiffies = jiffies;
runtime->hw_ptr_interrupt = hw_ptr_interrupt;
if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE)
snd_pcm_gettime(runtime, (struct timespec *)&runtime->status->tstamp);

return snd_pcm_update_hw_ptr_post(substream, runtime);
}
Expand Down Expand Up @@ -356,9 +363,14 @@ int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream)
runtime->silence_size > 0)
snd_pcm_playback_silence(substream, new_hw_ptr);

if (runtime->status->hw_ptr != new_hw_ptr)
return 0;

runtime->hw_ptr_base = hw_base;
runtime->status->hw_ptr = new_hw_ptr;
runtime->hw_ptr_jiffies = jiffies;
if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_ENABLE)
snd_pcm_gettime(runtime, (struct timespec *)&runtime->status->tstamp);

return snd_pcm_update_hw_ptr_post(substream, runtime);
}
Expand Down

0 comments on commit afc12d6

Please sign in to comment.