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
1d00d55d
Commit
1d00d55d
authored
Sep 21, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player/Thread: stop buffering if buffer is full
Shouldn't ever happen, but who knows...
parent
a190db08
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
MusicBuffer.hxx
src/MusicBuffer.hxx
+6
-1
Thread.cxx
src/player/Thread.cxx
+1
-1
No files found.
src/MusicBuffer.hxx
View file @
1d00d55d
...
...
@@ -29,7 +29,7 @@
*/
class
MusicBuffer
{
/** a mutex which protects #buffer */
Mutex
mutex
;
mutable
Mutex
mutex
;
SliceBuffer
<
MusicChunk
>
buffer
;
...
...
@@ -53,6 +53,11 @@ public:
}
#endif
bool
IsFull
()
const
noexcept
{
const
std
::
lock_guard
<
Mutex
>
protect
(
mutex
);
return
buffer
.
IsFull
();
}
/**
* Returns the total number of reserved chunks in this buffer. This
* is the same value which was passed to the constructor
...
...
src/player/Thread.cxx
View file @
1d00d55d
...
...
@@ -944,7 +944,7 @@ Player::Run() noexcept
prevent stuttering on slow machines */
if
(
pipe
->
GetSize
()
<
pc
.
buffered_before_play
&&
!
dc
.
IsIdle
())
{
!
dc
.
IsIdle
()
&&
!
buffer
.
IsFull
()
)
{
/* not enough decoded buffer space yet */
dc
.
WaitForDecoder
();
...
...
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