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
95ac6071
Commit
95ac6071
authored
Apr 09, 2014
by
Marcello Desantis
Committed by
Max Kellermann
Apr 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/sndfile: work around libsndfile bug on partial read
parent
3a4e6670
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
NEWS
NEWS
+1
-0
SndfileDecoderPlugin.cxx
src/decoder/SndfileDecoderPlugin.cxx
+17
-3
No files found.
NEWS
View file @
95ac6071
...
@@ -3,6 +3,7 @@ ver 0.18.10 (not yet released)
...
@@ -3,6 +3,7 @@ ver 0.18.10 (not yet released)
- ffmpeg: fix seeking bug
- ffmpeg: fix seeking bug
- ffmpeg: handle unknown stream start time
- ffmpeg: handle unknown stream start time
- gme: fix memory leak
- gme: fix memory leak
- sndfile: work around libsndfile bug on partial read
* don't interrupt playback when current song gets deleted
* don't interrupt playback when current song gets deleted
ver 0.18.9 (2014/03/02)
ver 0.18.9 (2014/03/02)
...
...
src/decoder/SndfileDecoderPlugin.cxx
View file @
95ac6071
...
@@ -55,14 +55,28 @@ sndfile_vio_read(void *ptr, sf_count_t count, void *user_data)
...
@@ -55,14 +55,28 @@ sndfile_vio_read(void *ptr, sf_count_t count, void *user_data)
{
{
InputStream
&
is
=
*
(
InputStream
*
)
user_data
;
InputStream
&
is
=
*
(
InputStream
*
)
user_data
;
sf_count_t
total_bytes
=
0
;
Error
error
;
Error
error
;
size_t
nbytes
=
is
.
LockRead
(
ptr
,
count
,
error
);
if
(
nbytes
==
0
&&
error
.
IsDefined
())
{
/* this loop is necessary because libsndfile chokes on partial
reads */
do
{
size_t
nbytes
=
is
.
LockRead
((
char
*
)
ptr
+
total_bytes
,
count
-
total_bytes
,
error
);
if
(
nbytes
==
0
)
{
if
(
error
.
IsDefined
())
{
LogError
(
error
);
LogError
(
error
);
return
-
1
;
return
-
1
;
}
}
return
nbytes
;
break
;
}
total_bytes
+=
nbytes
;
}
while
(
total_bytes
<
count
);
return
total_bytes
;
}
}
static
sf_count_t
static
sf_count_t
...
...
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