]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Revert "aplay: fix pcm_read() return value"
authorJaroslav Kysela <perex@perex.cz>
Wed, 1 Oct 2014 13:43:57 +0000 (15:43 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 1 Oct 2014 13:43:57 +0000 (15:43 +0200)
This reverts commit 8aa13eec80eac312e4b99423909387660fb99b8f.

The semantics for pcm_read() and pcm_readv() was changed, but the
callers expect the exact frame count as requested. It's possible
to fix callers, but the fix is more complicated than to revert the
change. Note that '-d' processing was broken in some cases.

Note: The reverted commit allows that the return value might be
greater than requested (see the first condition in read routines).

aplay/aplay.c

index 30d3f319d97ad4eecd313aadb10f0ebedc98c12f..e58e1bcbdd7e5c784b85df90f15ef41326d3f6dd 100644 (file)
@@ -2039,7 +2039,7 @@ static ssize_t pcm_read(u_char *data, size_t rcount)
                        data += r * bits_per_frame / 8;
                }
        }
-       return result;
+       return rcount;
 }
 
 static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount)
@@ -2084,7 +2084,7 @@ static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount)
                        count -= r;
                }
        }
-       return result;
+       return rcount;
 }
 
 /*