Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
8b4829c2
Commit
8b4829c2
authored
Oct 24, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm_resample: support for libsamplerate < 0.1.3
libsamplerate 0.1.2 didn't have the 32 bit <-> float conversion routines. Emulate them in case they aren't supported.
parent
5fefa954
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
configure.ac
configure.ac
+5
-0
pcm_resample_libsamplerate.c
src/pcm_resample_libsamplerate.c
+20
-0
No files found.
configure.ac
View file @
8b4829c2
...
...
@@ -390,6 +390,11 @@ if test x$enable_lsr = xyes; then
[enable_lsr=no;AC_MSG_WARN([libsamplerate not found -- disabling])])
fi
if test x$enable_lsr = xyes; then
PKG_CHECK_MODULES([SAMPLERATE_013], [samplerate >= 0.1.3],,
[AC_DEFINE([HAVE_LIBSAMPLERATE_NOINT], 1, [libsamplerate doesn't provide src_int_to_float_array() (<0.1.3)])])
fi
AM_CONDITIONAL(HAVE_LIBSAMPLERATE, test x$enable_lsr = xyes)
if test x$enable_fifo = xyes; then
...
...
src/pcm_resample_libsamplerate.c
View file @
8b4829c2
...
...
@@ -154,6 +154,26 @@ pcm_resample_16(uint8_t channels,
return
data
->
output_frames_gen
*
sizeof
(
*
dest_buffer
)
*
channels
;
}
#ifdef HAVE_LIBSAMPLERATE_NOINT
/* libsamplerate introduced these functions in v0.1.3 */
static
void
src_int_to_float_array
(
const
int
*
in
,
float
*
out
,
int
len
)
{
while
(
len
--
>
0
)
*
out
++
=
*
in
++
/
(
float
)(
1
<<
(
24
-
1
));
}
static
void
src_float_to_int_array
(
const
float
*
in
,
int
*
out
,
int
len
)
{
while
(
len
--
>
0
)
*
out
++
=
*
in
++
*
(
float
)(
1
<<
(
24
-
1
));
}
#endif
size_t
pcm_resample_24
(
uint8_t
channels
,
unsigned
src_rate
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment