]> git.alsa-project.org Git - alsa-utils.git/commit
aplay: Print '=== PAUSE ===' only if it is supported
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Mon, 22 Jul 2024 06:03:00 +0000 (09:03 +0300)
committerJaroslav Kysela <perex@perex.cz>
Tue, 6 Aug 2024 16:37:51 +0000 (18:37 +0200)
commitcbebb86a56991042b86286625be06c894b050675
tree30837d012717df0927ac276f83f813ada7f8dc7b
parent6e3fc0433e7eddf16e8c7766c0b578c7659e8d9c
aplay: Print '=== PAUSE ===' only if it is supported

Instead of printing the '=== PAUSE ===' unconditionally before calling
do_pause(), move it to the function and only print it if the stream can
be paused.

If the stream cannot be paused that the '=== PAUSE ===' will be replaced
by `PAUSE command ignored (no hw support)` immediately, which is not
observable by users but automation scripts will catch the '=== PAUSE ==='
and might think that the stream is indeed got paused.

Move the print into do_pause() function after the snd_pcm_pause() have
returned without error to make sure it is only printed if the stream is
paused and we are waiting for the pause release from user to proceed.

Closes: https://github.com/alsa-project/alsa-utils/pull/271
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
aplay/aplay.c