Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 81623
b: refs/heads/master
c: 8c12158
h: refs/heads/master
i:
  81621: 5ac7c4b
  81619: 128eb8f
  81615: f51840e
v: v3
  • Loading branch information
Jaroslav Kysela committed Jan 31, 2008
1 parent c0efe8a commit d07149e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 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: a64135a2d880183a2aff149f42dab7779a37a67f
refs/heads/master: 8c12158687fc78091730d5456336b7efbf6f2250
4 changes: 2 additions & 2 deletions trunk/include/sound/asound.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ struct snd_pcm_hw_params {

enum {
SNDRV_PCM_TSTAMP_NONE = 0,
SNDRV_PCM_TSTAMP_MMAP,
SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_MMAP,
SNDRV_PCM_TSTAMP_ENABLE,
SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
};

struct snd_pcm_sw_params {
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/core/pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static char *snd_pcm_subformat_names[] = {

static char *snd_pcm_tstamp_mode_names[] = {
TSTAMP(NONE),
TSTAMP(MMAP),
TSTAMP(ENABLE),
};

static const char *snd_pcm_stream_name(int stream)
Expand Down
4 changes: 2 additions & 2 deletions trunk/sound/core/pcm_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ static inline snd_pcm_uframes_t snd_pcm_update_hw_ptr_pos(struct snd_pcm_substre
{
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 @@ -186,8 +188,6 @@ static inline int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *subs
snd_pcm_uframes_t new_hw_ptr, hw_ptr_interrupt;
snd_pcm_sframes_t delta;

if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_MMAP)
snd_pcm_gettime(runtime, (struct timespec *)&runtime->status->tstamp);
pos = snd_pcm_update_hw_ptr_pos(substream, runtime);
if (pos == SNDRV_PCM_POS_XRUN) {
xrun(substream);
Expand Down
8 changes: 7 additions & 1 deletion trunk/sound/core/pcm_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,15 @@ 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_ENABLE) {
status->tstamp = runtime->status->tstamp;
goto _tstamp_end;
}
}
snd_pcm_gettime(runtime, &status->tstamp);
_tstamp_end:
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 d07149e

Please sign in to comment.