pcm: status dump fix timestamp formatting
PATCH 4/6 pcm: status dump fix timestamp formatting
From: Andreas Pape <[email protected]>
nanosecond part formatted with %06 will give incorrect/confusing results:
trigger_time: 154.9748287trigger_time: 154.60109090trigger_time: 154.110425257
time seems to run backwards...
This patch converts to us before printing
which gives the correct/expected result:
trigger_time: 154.009748trigger_time: 154.060109trigger_time: 154.110425
src/pcm/pcm.c +3 -2
@@ -2194,9 +2194,10 @@ int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out)assert (status);snd_output_printf (out," state : %s\n" ,snd_pcm_state_name ((snd_pcm_state_t ) status->state));snd_output_printf (out," trigger_time: %ld.%06ld\n" , - status->trigger_tstamp.tv_sec, status->trigger_tstamp.tv_nsec); + status->trigger_tstamp.tv_sec, + status->trigger_tstamp.tv_nsec /1000 );snd_output_printf (out," tstamp : %ld.%06ld\n" , - status->tstamp.tv_sec, status->tstamp.tv_nsec); + status->tstamp.tv_sec, status->tstamp.tv_nsec /1000 );snd_output_printf (out," delay : %ld\n" , (long )status->delay);snd_output_printf (out," avail : %ld\n" , (long )status->avail);snd_output_printf (out," avail_max : %ld\n" , (long )status->avail_max);
Signature · 1 line
2.7.4
Takashi Iwai
AppliedQuoted 14 lines · On Fri, 17 Feb 2017 08:17:36 +0100, [email protected] wrote:
From: Andreas Pape <[email protected]>
nanosecond part formatted with %06 will give incorrect/confusing results:
trigger_time: 154.9748287trigger_time: 154.60109090trigger_time: 154.110425257time seems to run backwards...
This patch converts to us before printing
which gives the correct/expected result:
Quoted 6 lines
trigger_time: 154.009748trigger_time: 154.060109trigger_time: 154.110425Signed-off-by Andreas Pape <[email protected]>Signed-off-by Mounesh Sutar <[email protected]>
Applied, thanks.
Takashi