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
dba45a59
Commit
dba45a59
authored
May 26, 2007
by
J. Alexander Treuman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaning up pcm_getSampleRateConverter.
git-svn-id:
https://svn.musicpd.org/mpd/trunk@6275
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
665ab837
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
23 deletions
+27
-23
pcm_utils.c
src/pcm_utils.c
+27
-23
No files found.
src/pcm_utils.c
View file @
dba45a59
...
...
@@ -151,32 +151,36 @@ void pcm_mix(char *buffer1, char *buffer2, size_t bufferSize1,
#ifdef HAVE_LIBSAMPLERATE
static
int
pcm_getSampleRateConverter
(
void
)
{
const
char
*
conf
,
*
test
;
int
convalgo
=
SRC_SINC_FASTEST
;
int
newalgo
;
const
char
*
conf
=
getConfigParamValue
(
CONF_SAMPLERATE_CONVERTER
)
;
long
convalgo
;
char
*
test
;
size_t
len
;
conf
=
getConfigParamValue
(
CONF_SAMPLERATE_CONVERTER
);
if
(
conf
)
{
newalgo
=
strtol
(
conf
,
(
char
**
)
&
test
,
10
);
if
(
*
test
)
{
len
=
strlen
(
conf
);
for
(
newalgo
=
0
;
;
newalgo
++
)
{
test
=
src_get_name
(
newalgo
);
if
(
!
test
)
break
;
/* FAIL */
if
(
!
strncasecmp
(
test
,
conf
,
len
))
{
convalgo
=
newalgo
;
break
;
}
}
}
else
{
if
(
src_get_name
(
newalgo
))
convalgo
=
newalgo
;
/* else FAIL */
if
(
!
conf
)
{
convalgo
=
SRC_SINC_FASTEST
;
goto
out
;
}
convalgo
=
strtol
(
conf
,
&
test
,
10
);
if
(
*
test
==
'\0'
&&
src_get_name
(
convalgo
))
goto
out
;
len
=
strlen
(
conf
);
for
(
convalgo
=
0
;
;
convalgo
++
)
{
test
=
(
char
*
)
src_get_name
(
convalgo
);
if
(
!
test
)
{
convalgo
=
SRC_SINC_FASTEST
;
break
;
}
if
(
strncasecmp
(
test
,
conf
,
len
)
==
0
)
goto
out
;
}
DEBUG
(
"Selecting samplerate converter '%s'
\n
"
,
src_get_name
(
convalgo
));
ERROR
(
"unknown samplerate converter
\"
%s
\"\n
"
,
conf
);
out:
DEBUG
(
"selecting samplerate converter
\"
%s
\"\n
"
,
src_get_name
(
convalgo
));
return
convalgo
;
}
#endif
...
...
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