diff mbox

[2/2] aplay: Escape from pcm_write() when in_aborting state

Message ID 1402642797.26748747@f39.i.mail.ru (mailing list archive)
State New, archived
Headers show

Commit Message

Sergey June 13, 2014, 6:59 a.m. UTC
This patch fixes aplay freezing and not responding to Ctrl+C
when playback pcm is stuck and returns 0 to write attempts:
Example:
  # aplay -vvv /dev/zero
  pcm.!default {
    type plug
    slave.pcm { type null }
    slave.format S32_LE
  }
---
 aplay/aplay.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/aplay/aplay.c b/aplay/aplay.c
index 77e40a3..a5b9c2a 100644
--- a/aplay/aplay.c
+++ b/aplay/aplay.c
@@ -1921,7 +1921,7 @@  static ssize_t pcm_write(u_char *data, size_t count)
 		count = chunk_size;
 	}
 	data = remap_data(data, count);
-	while (count > 0) {
+	while (count > 0 && !in_aborting) {
 		if (test_position)
 			do_test_position();
 		check_stdin();