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
953b258e
Commit
953b258e
authored
Jan 16, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm_resample_fallback: corrected the sample calculation
Due to rounding errors, it was possible that the fallback resampler returned partial frames.
parent
285a741b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
NEWS
NEWS
+1
-0
pcm_resample_fallback.c
src/pcm_resample_fallback.c
+8
-6
No files found.
NEWS
View file @
953b258e
...
...
@@ -29,6 +29,7 @@ MPD 0.14.1 - not yet released
- honour http_proxy_* config directives
- fix assertion failure on "connection refused"
- fix assertion failure with empty HTTP responses
* corrected the sample calculation in the fallback resampler
* log: automatically append newline
* fix setenv() conflict on Solaris
* configure.ac: check for pkg-config before using it
...
...
src/pcm_resample_fallback.c
View file @
953b258e
...
...
@@ -37,9 +37,10 @@ pcm_resample_16(struct pcm_resample_state *state,
size_t
*
dest_size_r
)
{
unsigned
src_pos
,
dest_pos
=
0
;
unsigned
src_samples
=
src_size
/
sizeof
(
*
src_buffer
);
unsigned
dest_samples
=
(
src_samples
*
dest_rate
+
src_rate
-
1
)
/
src_rate
;
unsigned
src_frames
=
src_size
/
channels
/
sizeof
(
*
src_buffer
);
unsigned
dest_frames
=
(
src_frames
*
dest_rate
+
src_rate
-
1
)
/
src_rate
;
unsigned
dest_samples
=
dest_frames
*
channels
;
size_t
dest_size
=
dest_samples
*
sizeof
(
*
src_buffer
);
int16_t
*
dest_buffer
=
pcm_buffer_get
(
&
state
->
buffer
,
dest_size
);
...
...
@@ -77,9 +78,10 @@ pcm_resample_24(struct pcm_resample_state *state,
size_t
*
dest_size_r
)
{
unsigned
src_pos
,
dest_pos
=
0
;
unsigned
src_samples
=
src_size
/
sizeof
(
*
src_buffer
);
unsigned
dest_samples
=
(
src_samples
*
dest_rate
+
src_rate
-
1
)
/
src_rate
;
unsigned
src_frames
=
src_size
/
channels
/
sizeof
(
*
src_buffer
);
unsigned
dest_frames
=
(
src_frames
*
dest_rate
+
src_rate
-
1
)
/
src_rate
;
unsigned
dest_samples
=
dest_frames
*
channels
;
size_t
dest_size
=
dest_samples
*
sizeof
(
*
src_buffer
);
int32_t
*
dest_buffer
=
pcm_buffer_get
(
&
state
->
buffer
,
dest_size
);
...
...
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