From: David Henningsson <coding@diwic.se>
To: alsa-devel@alsa-project.org, tiwai@suse.de
Cc: David Henningsson <coding@diwic.se>
Subject: [PATCH 2/2] test/audio_time: Make use of SND_PCM_AUDIO_TSTAMP_TYPE constants
Date: Tue, 22 Dec 2020 15:57:28 +0100 [thread overview]
Message-ID: <20201222145728.9368-3-coding@diwic.se> (raw)
In-Reply-To: <20201222145728.9368-1-coding@diwic.se>
Also fixup the usage row which seemed wrong to me.
Signed-off-by: David Henningsson <coding@diwic.se>
---
test/audio_time.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/test/audio_time.c b/test/audio_time.c
index 530922d9..e4d4a944 100644
--- a/test/audio_time.c
+++ b/test/audio_time.c
@@ -32,7 +32,7 @@ static void usage(char *command)
"-d, --delay add delay \n"
"-D, --device=NAME select PCM by name \n"
"-p, --playback playback tstamps \n"
- "-t, --ts_type=TYPE Default(0),link(1),link_estimated(2),synchronized(3) \n"
+ "-t, --ts_type=TYPE Compat(0),default(1),link(2),link_absolute(3),link_estimated(4),link_synchronized(5) \n"
"-r, --report show audio timestamp and accuracy validity\n"
, command);
}
@@ -201,17 +201,17 @@ int main(int argc, char *argv[])
goto _exit;
}
- if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_p, 0))
+ if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_p, SND_PCM_AUDIO_TSTAMP_TYPE_COMPAT))
printf("Playback supports audio compat timestamps\n");
- if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_p, 1))
+ if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_p, SND_PCM_AUDIO_TSTAMP_TYPE_DEFAULT))
printf("Playback supports audio default timestamps\n");
- if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_p, 2))
+ if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_p, SND_PCM_AUDIO_TSTAMP_TYPE_LINK))
printf("Playback supports audio link timestamps\n");
- if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_p, 3))
+ if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_p, SND_PCM_AUDIO_TSTAMP_TYPE_LINK_ABSOLUTE))
printf("Playback supports audio link absolute timestamps\n");
- if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_p, 4))
+ if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_p, SND_PCM_AUDIO_TSTAMP_TYPE_LINK_ESTIMATED))
printf("Playback supports audio link estimated timestamps\n");
- if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_p, 5))
+ if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_p, SND_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED))
printf("Playback supports audio link synchronized timestamps\n");
snd_pcm_sw_params_alloca(&swparams_p);
@@ -269,17 +269,17 @@ int main(int argc, char *argv[])
goto _exit;
}
- if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_c, 0))
+ if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_c, SND_PCM_AUDIO_TSTAMP_TYPE_COMPAT))
printf("Capture supports audio compat timestamps\n");
- if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_c, 1))
+ if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_c, SND_PCM_AUDIO_TSTAMP_TYPE_DEFAULT))
printf("Capture supports audio default timestamps\n");
- if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_c, 2))
+ if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_c, SND_PCM_AUDIO_TSTAMP_TYPE_LINK))
printf("Capture supports audio link timestamps\n");
- if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_c, 3))
+ if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_c, SND_PCM_AUDIO_TSTAMP_TYPE_LINK_ABSOLUTE))
printf("Capture supports audio link absolute timestamps\n");
- if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_c, 4))
+ if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_c, SND_PCM_AUDIO_TSTAMP_TYPE_LINK_ESTIMATED))
printf("Capture supports audio link estimated timestamps\n");
- if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_c, 5))
+ if (snd_pcm_hw_params_supports_audio_ts_type(hwparams_c, SND_PCM_AUDIO_TSTAMP_TYPE_LINK_SYNCHRONIZED))
printf("Capture supports audio link synchronized timestamps\n");
snd_pcm_sw_params_alloca(&swparams_c);
--
2.25.1
next prev parent reply other threads:[~2020-12-22 14:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-22 14:57 [PATCH 0/2] Publish snd_pcm_audio_tstamp_type_t constants David Henningsson
2020-12-22 14:57 ` [PATCH 1/2] pcm: Add " David Henningsson
2020-12-22 14:57 ` David Henningsson [this message]
2020-12-22 15:11 ` [PATCH 0/2] Publish " Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201222145728.9368-3-coding@diwic.se \
--to=coding@diwic.se \
--cc=alsa-devel@alsa-project.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox