mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-09 18:05:42 +01:00
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>
This commit is contained in:
parent
6e3fc0433e
commit
cbebb86a56
1 changed files with 2 additions and 2 deletions
|
@ -1618,6 +1618,8 @@ static void do_pause(void)
|
||||||
error(_("pause push error: %s"), snd_strerror(err));
|
error(_("pause push error: %s"), snd_strerror(err));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
fprintf(stderr, _("\r=== PAUSE === "));
|
||||||
|
fflush(stderr);
|
||||||
while (1) {
|
while (1) {
|
||||||
b = wait_for_input();
|
b = wait_for_input();
|
||||||
if (b == ' ' || b == '\r') {
|
if (b == ' ' || b == '\r') {
|
||||||
|
@ -1642,8 +1644,6 @@ static void check_stdin(void)
|
||||||
while (read(fileno(stdin), &b, 1) == 1) {
|
while (read(fileno(stdin), &b, 1) == 1) {
|
||||||
if (b == ' ' || b == '\r') {
|
if (b == ' ' || b == '\r') {
|
||||||
while (read(fileno(stdin), &b, 1) == 1);
|
while (read(fileno(stdin), &b, 1) == 1);
|
||||||
fprintf(stderr, _("\r=== PAUSE === "));
|
|
||||||
fflush(stderr);
|
|
||||||
do_pause();
|
do_pause();
|
||||||
fprintf(stderr, " \r");
|
fprintf(stderr, " \r");
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
|
Loading…
Reference in a new issue