Skip to content

Commit cbebb86

Browse files
ujfalusiperexg
authored andcommitted
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: #271 Signed-off-by: Peter Ujfalusi <[email protected]> Signed-off-by: Jaroslav Kysela <[email protected]>
1 parent 6e3fc04 commit cbebb86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aplay/aplay.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,8 @@ static void do_pause(void)
16181618
error(_("pause push error: %s"), snd_strerror(err));
16191619
return;
16201620
}
1621+
fprintf(stderr, _("\r=== PAUSE === "));
1622+
fflush(stderr);
16211623
while (1) {
16221624
b = wait_for_input();
16231625
if (b == ' ' || b == '\r') {
@@ -1642,8 +1644,6 @@ static void check_stdin(void)
16421644
while (read(fileno(stdin), &b, 1) == 1) {
16431645
if (b == ' ' || b == '\r') {
16441646
while (read(fileno(stdin), &b, 1) == 1);
1645-
fprintf(stderr, _("\r=== PAUSE === "));
1646-
fflush(stderr);
16471647
do_pause();
16481648
fprintf(stderr, " \r");
16491649
fflush(stderr);

0 commit comments

Comments
 (0)