forked from pool/alsa-utils
This commit is contained in:
parent
90462e7a56
commit
974d4566ef
46
alsa-utils-speaker-test-parameter-get-fix.diff
Normal file
46
alsa-utils-speaker-test-parameter-get-fix.diff
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
commit 0d6134450ea7db82128138c9ac1bc84e8696dce4
|
||||||
|
Author: Takashi Iwai <tiwai@suse.de>
|
||||||
|
Date: Wed Nov 26 14:27:24 2008 +0100
|
||||||
|
|
||||||
|
speaker-test: Fix floating-point exception bug
|
||||||
|
|
||||||
|
The period_size an buffer_size parameters must be taken after calling
|
||||||
|
snd_pcm_hw_params(). Otherwise they could be undefined numbers.
|
||||||
|
For example, period_size gets 0 when pcsp driver is used, resulting in
|
||||||
|
a floating-point exception error.
|
||||||
|
|
||||||
|
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||||
|
|
||||||
|
diff --git a/speaker-test/speaker-test.c b/speaker-test/speaker-test.c
|
||||||
|
index d40342f..75a4bed 100644
|
||||||
|
--- a/speaker-test/speaker-test.c
|
||||||
|
+++ b/speaker-test/speaker-test.c
|
||||||
|
@@ -422,6 +422,14 @@ static int set_hwparams(snd_pcm_t *handle, snd_pcm_hw_params_t *params, snd_pcm_
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ /* write the parameters to device */
|
||||||
|
+ err = snd_pcm_hw_params(handle, params);
|
||||||
|
+ if (err < 0) {
|
||||||
|
+ fprintf(stderr, _("Unable to set hw params for playback: %s\n"), snd_strerror(err));
|
||||||
|
+ return err;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
snd_pcm_hw_params_get_buffer_size(params, &buffer_size);
|
||||||
|
snd_pcm_hw_params_get_period_size(params, &period_size, NULL);
|
||||||
|
printf(_("was set period_size = %lu\n"),period_size);
|
||||||
|
@@ -431,13 +439,6 @@ static int set_hwparams(snd_pcm_t *handle, snd_pcm_hw_params_t *params, snd_pcm_
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
- /* write the parameters to device */
|
||||||
|
- err = snd_pcm_hw_params(handle, params);
|
||||||
|
- if (err < 0) {
|
||||||
|
- fprintf(stderr, _("Unable to set hw params for playback: %s\n"), snd_strerror(err));
|
||||||
|
- return err;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Nov 26 14:31:40 CET 2008 - tiwai@suse.de
|
||||||
|
|
||||||
|
- fix division-by-zero error in speaker-test program
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Oct 29 14:32:47 CET 2008 - tiwai@suse.de
|
Wed Oct 29 14:32:47 CET 2008 - tiwai@suse.de
|
||||||
|
|
||||||
|
@ -28,10 +28,11 @@ Requires: dialog pciutils
|
|||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
Summary: Advanced Linux Sound Architecture Utilities
|
Summary: Advanced Linux Sound Architecture Utilities
|
||||||
Version: 1.0.18
|
Version: 1.0.18
|
||||||
Release: 5
|
Release: 6
|
||||||
Source: ftp://ftp.alsa-project.org/pub/util/alsa-utils-%{package_version}.tar.bz2
|
Source: ftp://ftp.alsa-project.org/pub/util/alsa-utils-%{package_version}.tar.bz2
|
||||||
# Patch: alsa-utils-git-fixes.diff
|
# Patch: alsa-utils-git-fixes.diff
|
||||||
# Patch1: alsa-utils-%{package_version}-package-fix.diff
|
# Patch1: alsa-utils-%{package_version}-package-fix.diff
|
||||||
|
Patch2: alsa-utils-speaker-test-parameter-get-fix.diff
|
||||||
Url: http://www.alsa-project.org/
|
Url: http://www.alsa-project.org/
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
|
||||||
@ -50,6 +51,7 @@ Authors:
|
|||||||
%setup -q -n %{name}-%{package_version}
|
%setup -q -n %{name}-%{package_version}
|
||||||
# %patch1 -p1
|
# %patch1 -p1
|
||||||
# %patch -p1
|
# %patch -p1
|
||||||
|
%patch2 -p1
|
||||||
mv alsamixer/README alsamixer/README-alsamixer
|
mv alsamixer/README alsamixer/README-alsamixer
|
||||||
|
|
||||||
%build
|
%build
|
||||||
@ -78,6 +80,8 @@ make DESTDIR=$RPM_BUILD_ROOT install
|
|||||||
%{_datadir}/alsa
|
%{_datadir}/alsa
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Nov 26 2008 tiwai@suse.de
|
||||||
|
- fix division-by-zero error in speaker-test program
|
||||||
* Wed Oct 29 2008 tiwai@suse.de
|
* Wed Oct 29 2008 tiwai@suse.de
|
||||||
- updated to version 1.0.18-final;
|
- updated to version 1.0.18-final;
|
||||||
just including all previous fixes
|
just including all previous fixes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user