Skip to content

Commit

Permalink
[ALSA] PCM core - remove SNDRV_PCM_TSTAMP_MMAP condition in snd_pcm_s…
Browse files Browse the repository at this point in the history
…tatus()

The condition caused that the returned ring buffer position does not match
with timestamp when SNDRV_PCM_TSTAMP_MMAP mode was enabled. Removing
condition makes unified behaviour and interrupt based timestamp can be
accessed via PCM_IOCTL_SYNC_PTR or mmaped status area.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
  • Loading branch information
Jaroslav Kysela committed Jan 31, 2008
1 parent 0678acc commit a713b58
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions sound/core/pcm_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,14 +593,9 @@ int snd_pcm_status(struct snd_pcm_substream *substream,
if (status->state == SNDRV_PCM_STATE_OPEN)
goto _end;
status->trigger_tstamp = runtime->trigger_tstamp;
if (snd_pcm_running(substream)) {
if (snd_pcm_running(substream))
snd_pcm_update_hw_ptr(substream);
if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_MMAP)
status->tstamp = runtime->status->tstamp;
else
snd_pcm_gettime(runtime, &status->tstamp);
} else
snd_pcm_gettime(runtime, &status->tstamp);
snd_pcm_gettime(runtime, &status->tstamp);
status->appl_ptr = runtime->control->appl_ptr;
status->hw_ptr = runtime->status->hw_ptr;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
Expand Down

0 comments on commit a713b58

Please sign in to comment.