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
ca06d9d3
Commit
ca06d9d3
authored
May 16, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/buffered: fix deadlock bug
parent
ed2db04f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
NEWS
NEWS
+2
-0
BufferedInputStream.cxx
src/input/BufferedInputStream.cxx
+24
-0
No files found.
NEWS
View file @
ca06d9d3
ver 0.21.9 (not yet released)
* input
- buffer: fix deadlock bug
* Android
- fix crash on ARMv7
- request storage permission on Android 6+
...
...
src/input/BufferedInputStream.cxx
View file @
ca06d9d3
...
...
@@ -165,6 +165,30 @@ BufferedInputStream::RunThread() noexcept
seek
=
false
;
client_cond
.
signal
();
}
else
if
(
!
idle
&&
!
read_error
&&
offset
!=
input
->
GetOffset
()
&&
!
IsAvailable
())
{
/* a past Seek() call was a no-op because data
was already available at that position, but
now we've reached a new position where
there is no more data in the buffer, and
our input is reading somewhere else (maybe
stuck at the end of the file); to find a
way out, we now seek our input to our
reading position to be able to fill our
buffer */
try
{
input
->
Seek
(
offset
);
}
catch
(...)
{
/* this is really a seek error, but we
register it as a read_error,
because seek_error is only checked
by Seek(), and at our frontend (our
own InputStream interface) is in
"read" mode */
read_error
=
std
::
current_exception
();
}
}
else
if
(
!
idle
&&
!
read_error
&&
input
->
IsAvailable
()
&&
!
input
->
IsEOF
())
{
const
auto
read_offset
=
input
->
GetOffset
();
auto
w
=
buffer
.
Write
(
read_offset
);
...
...
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