]> git.alsa-project.org Git - alsa-lib.git/commitdiff
test/audio_time: Make use of SND_PCM_AUDIO_TSTAMP_TYPE constants
authorDavid Henningsson <diwic@ubuntu.com>
Wed, 16 Dec 2020 19:02:52 +0000 (20:02 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 17 Dec 2020 10:26:15 +0000 (11:26 +0100)
Also fixup the usage row which seemed wrong to me.

Signed-off-by: David Henningsson <diwic@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
test/audio_time.c

index 530922d92d432c2bb4e07f36b4aa556c8a479719..e4d4a9448c6d97e8ebb8f513314e0bef48c3cbc2 100644 (file)
@@ -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);