forked from pool/chocolate-doom
- Add chdoom-sdlsound.diff
OBS-URL: https://build.opensuse.org/package/show/games/chocolate-doom?expand=0&rev=24
This commit is contained in:
parent
f5d64c484f
commit
781379921d
53
chdoom-sdlsound.diff
Normal file
53
chdoom-sdlsound.diff
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
From ffb5656588db391889890c65c206b5e170c084e7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Fabian Greffrath <fabian@greffrath.com>
|
||||||
|
Date: Mon, 24 Oct 2016 15:30:18 +0200
|
||||||
|
Subject: [PATCH] i_sdlsound.c: fix compilation with libsamplerate 0.1.9
|
||||||
|
|
||||||
|
This new version has const-corrected the data_in field, fixes #788
|
||||||
|
---
|
||||||
|
src/i_sdlsound.c | 8 +++++---
|
||||||
|
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/i_sdlsound.c b/src/i_sdlsound.c
|
||||||
|
index 79a15db..2d7a620 100644
|
||||||
|
--- a/src/i_sdlsound.c
|
||||||
|
+++ b/src/i_sdlsound.c
|
||||||
|
@@ -339,6 +339,7 @@ static boolean ExpandSoundData_SRC(sfxinfo_t *sfxinfo,
|
||||||
|
int length)
|
||||||
|
{
|
||||||
|
SRC_DATA src_data;
|
||||||
|
+ float *data_in;
|
||||||
|
uint32_t i, abuf_index=0, clipped=0;
|
||||||
|
// uint32_t alen;
|
||||||
|
int retn;
|
||||||
|
@@ -346,7 +347,8 @@ static boolean ExpandSoundData_SRC(sfxinfo_t *sfxinfo,
|
||||||
|
Mix_Chunk *chunk;
|
||||||
|
|
||||||
|
src_data.input_frames = length;
|
||||||
|
- src_data.data_in = malloc(length * sizeof(float));
|
||||||
|
+ data_in = malloc(length * sizeof(float));
|
||||||
|
+ src_data.data_in = data_in;
|
||||||
|
src_data.src_ratio = (double)mixer_freq / samplerate;
|
||||||
|
|
||||||
|
// We include some extra space here in case of rounding-up.
|
||||||
|
@@ -362,7 +364,7 @@ static boolean ExpandSoundData_SRC(sfxinfo_t *sfxinfo,
|
||||||
|
// Unclear whether 128 should be interpreted as "zero" or whether a
|
||||||
|
// symmetrical range should be assumed. The following assumes a
|
||||||
|
// symmetrical range.
|
||||||
|
- src_data.data_in[i] = data[i] / 127.5 - 1;
|
||||||
|
+ data_in[i] = data[i] / 127.5 - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do the sound conversion
|
||||||
|
@@ -430,7 +432,7 @@ static boolean ExpandSoundData_SRC(sfxinfo_t *sfxinfo,
|
||||||
|
expanded[abuf_index++] = cvtval_i;
|
||||||
|
}
|
||||||
|
|
||||||
|
- free(src_data.data_in);
|
||||||
|
+ free(data_in);
|
||||||
|
free(src_data.data_out);
|
||||||
|
|
||||||
|
if (clipped > 0)
|
||||||
|
--
|
||||||
|
2.10.2
|
||||||
|
|
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Nov 16 00:18:05 UTC 2016 - jengelh@inai.de
|
||||||
|
|
||||||
|
- Add chdoom-sdlsound.diff to resolve build error with new
|
||||||
|
libsamplerate
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sat Nov 7 10:04:03 UTC 2015 - jengelh@inai.de
|
Sat Nov 7 10:04:03 UTC 2015 - jengelh@inai.de
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package chocolate-doom
|
# spec file for package chocolate-doom
|
||||||
#
|
#
|
||||||
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -32,6 +32,7 @@ Source2: http://www.chocolate-doom.org/downloads/%rversion/%name-%rversio
|
|||||||
Source3: %name.keyring
|
Source3: %name.keyring
|
||||||
Patch1: chdoom-iwaddir.diff
|
Patch1: chdoom-iwaddir.diff
|
||||||
Patch4: chdoom-date.diff
|
Patch4: chdoom-date.diff
|
||||||
|
Patch5: chdoom-sdlsound.diff
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
BuildRequires: autoconf
|
BuildRequires: autoconf
|
||||||
BuildRequires: automake
|
BuildRequires: automake
|
||||||
@ -63,15 +64,15 @@ Chocolate Doom's aims are:
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -Tqb0 -n %name-%rversion
|
%setup -Tqb0 -n %name-%rversion
|
||||||
%patch -P 1 -P 4 -p1
|
%patch -P 1 -P 4 -P 5 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
autoreconf -fi
|
autoreconf -fi
|
||||||
%configure
|
%configure
|
||||||
make %{?_smp_mflags};
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
b="%buildroot";
|
b="%buildroot"
|
||||||
%make_install iconsdir="%_datadir/icons/hicolor/64x64/apps" \
|
%make_install iconsdir="%_datadir/icons/hicolor/64x64/apps" \
|
||||||
docdir="%_docdir/%name"
|
docdir="%_docdir/%name"
|
||||||
mkdir -p "$b/%_bindir"
|
mkdir -p "$b/%_bindir"
|
||||||
|
Loading…
Reference in New Issue
Block a user