[PATCH 1/2] ALSA: pcm: generate default audio timestamp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If there is no get_time_info() available or the requested audio
timestamp type is AUDIO_TSTAMP_TYPE_DEFAULT then need to set
audio_tstamp_report.actual_type = AUDIO_TSTAMP_TYPE_DEFAULT (in the
else clause near the start of snd_pcm_update_hw_ptr0()) in order for
update_audio_tstamp() to generate the audio timestamp from the number
of frames.

Fixes: 3179f6200188 ("ALSA: core: add .get_time_info")
Signed-off-by: consult.awy@xxxxxxxxx
Reviewed-by: Jaroslav Kysela <perex@xxxxxxxx>
---
 sound/core/pcm_lib.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 8b6aeb8a78f7..943f5396fc60 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -289,8 +289,10 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
 			/* re-test in case tstamp type is not supported in hardware and was demoted to DEFAULT */
 			if (runtime->audio_tstamp_report.actual_type == SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT)
 				snd_pcm_gettime(runtime, &curr_tstamp);
-		} else
+		} else {
+			runtime->audio_tstamp_report.actual_type = SNDRV_PCM_AUDIO_TSTAMP_TYPE_DEFAULT;
 			snd_pcm_gettime(runtime, &curr_tstamp);
+		}
 	}
 
 	if (pos == SNDRV_PCM_POS_XRUN) {
-- 
2.31.1




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux