[PATCH] Aplay: pcm_read(): return read samples instead of requested upon abort

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



aplay: pcm_read(): return read samples instead of requested upon abort

    This patch changes the logic of pcm_read() when abort signal has been
    detected. During such condition we should return the amount of frames
    actually read instead of the size requested by caller.

    Signed-off-by: Marcin Rajwa <marcin.rajwa@xxxxxxxxxxxxxxx>

diff --git a/aplay/aplay.c b/aplay/aplay.c
index 5d4b56e..6836558 100644
--- a/aplay/aplay.c
+++ b/aplay/aplay.c
@@ -2135,7 +2135,9 @@ static ssize_t pcm_read(u_char *data, size_t rcount)
                count = chunk_size;
        }

-       while (count > 0 && !in_aborting) {
+       while (count > 0) {
+               if (in_aborting)
+                       return result;
                if (test_position)
                        do_test_position();
                check_stdin();




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux