From d4fb6a238eb88c5d9a661d5e26339c8a3d007c86 Mon Sep 17 00:00:00 2001 From: Isaac Hermida Date: Tue, 13 Oct 2015 16:22:18 +0200 Subject: [PATCH] meta-digi-dey: alsa-utils: Fix for pcm read return value Duration (-d) option was broken. cherry pick from 8f361d83cfcb39887f5fc591633e68d9448e3425. https://jira.digi.com/browse/DEL-1828 Signed-off-by: Isaac Hermida --- .../aplay-fix-pcm_read-return-value.patch | 43 +++++++++++++++++++ .../alsa/alsa-utils_1.0.28.bbappend | 5 +++ 2 files changed, 48 insertions(+) create mode 100644 meta-digi-dey/recipes-multimedia/alsa/alsa-utils-1.0.28/aplay-fix-pcm_read-return-value.patch create mode 100644 meta-digi-dey/recipes-multimedia/alsa/alsa-utils_1.0.28.bbappend diff --git a/meta-digi-dey/recipes-multimedia/alsa/alsa-utils-1.0.28/aplay-fix-pcm_read-return-value.patch b/meta-digi-dey/recipes-multimedia/alsa/alsa-utils-1.0.28/aplay-fix-pcm_read-return-value.patch new file mode 100644 index 000000000..cd9c27366 --- /dev/null +++ b/meta-digi-dey/recipes-multimedia/alsa/alsa-utils-1.0.28/aplay-fix-pcm_read-return-value.patch @@ -0,0 +1,43 @@ +From 8f361d83cfcb39887f5fc591633e68d9448e3425 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 1 Oct 2014 15:43:57 +0200 +Subject: [PATCH] Revert "aplay: fix pcm_read() return value" + +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 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/aplay/aplay.c b/aplay/aplay.c +index 30d3f319d97a..e58e1bcbdd7e 100644 +--- a/aplay/aplay.c ++++ b/aplay/aplay.c +@@ -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; + } + + /* +-- +1.9.1 + diff --git a/meta-digi-dey/recipes-multimedia/alsa/alsa-utils_1.0.28.bbappend b/meta-digi-dey/recipes-multimedia/alsa/alsa-utils_1.0.28.bbappend new file mode 100644 index 000000000..9ffa729c0 --- /dev/null +++ b/meta-digi-dey/recipes-multimedia/alsa/alsa-utils_1.0.28.bbappend @@ -0,0 +1,5 @@ +# Copyright (C) 2015 Digi International. + +FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:" + +SRC_URI += "file://aplay-fix-pcm_read-return-value.patch"