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
6 years ago
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
Show 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 @@
...
@@ -29,7 +29,7 @@
*/
*/
class
MusicBuffer
{
class
MusicBuffer
{
/** a mutex which protects #buffer */
/** a mutex which protects #buffer */
Mutex
mutex
;
mutable
Mutex
mutex
;
SliceBuffer
<
MusicChunk
>
buffer
;
SliceBuffer
<
MusicChunk
>
buffer
;
...
@@ -53,6 +53,11 @@ public:
...
@@ -53,6 +53,11 @@ public:
}
}
#endif
#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
* Returns the total number of reserved chunks in this buffer. This
* is the same value which was passed to the constructor
* is the same value which was passed to the constructor
...
...
This diff is collapsed.
Click to expand it.
src/player/Thread.cxx
View file @
1d00d55d
...
@@ -944,7 +944,7 @@ Player::Run() noexcept
...
@@ -944,7 +944,7 @@ Player::Run() noexcept
prevent stuttering on slow machines */
prevent stuttering on slow machines */
if
(
pipe
->
GetSize
()
<
pc
.
buffered_before_play
&&
if
(
pipe
->
GetSize
()
<
pc
.
buffered_before_play
&&
!
dc
.
IsIdle
())
{
!
dc
.
IsIdle
()
&&
!
buffer
.
IsFull
()
)
{
/* not enough decoded buffer space yet */
/* not enough decoded buffer space yet */
dc
.
WaitForDecoder
();
dc
.
WaitForDecoder
();
...
...
This diff is collapsed.
Click to expand it.
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