Skip to contentSkip to conversation

Aplay: pcm_readv(): return read samples instead of requested upon abort

PATCH New Rajwa, Marcin 1 participant 2 messages Aug 7, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Aplay: pcm_readv(): return read samples instead of requested upon abort

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

    This patch changes the logic of pcm_readv() 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.

aplay/aplay.c +0 -0
index e8714d8..5d4b56e 100644
@@ -2174,7 +2174,9 @@ static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount)

                count = chunk_size;
        }

-       while (count > 0 && !in_aborting) {
+       while (count > 0) {
+               if (in_aborting)
+                       return result;
                unsigned int channel;
                void *bufs[channels];
                size_t offset = result;

#1 lore raw

PATCH 1/1 Aplay: pcm_read(): return read samples instead of requested upon abort

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.

aplay/aplay.c +0 -0
index 5d4b56e..6836558 100644
@@ -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();