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
c1600bcf
Commit
c1600bcf
authored
Sep 23, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player/Thread: copy `buffered_before_play`
parent
a82d864c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
Thread.cxx
src/player/Thread.cxx
+10
-3
No files found.
src/player/Thread.cxx
View file @
c1600bcf
...
...
@@ -79,6 +79,12 @@ class Player {
std
::
unique_ptr
<
Tag
>
cross_fade_tag
;
/**
* Start playback as soon as this number of chunks has been
* pushed to the decoder pipe.
*/
const
unsigned
buffer_before_play
;
/**
* If the decoder pipe gets consumed below this threshold,
* it's time to wake up the decoder.
*
...
...
@@ -89,7 +95,7 @@ class Player {
const
unsigned
decoder_wakeup_threshold
;
/**
*
are we waiting for buffered
_before_play?
*
Are we waiting for #buffer
_before_play?
*/
bool
buffering
=
true
;
...
...
@@ -185,6 +191,7 @@ public:
Player
(
PlayerControl
&
_pc
,
DecoderControl
&
_dc
,
MusicBuffer
&
_buffer
)
noexcept
:
pc
(
_pc
),
dc
(
_dc
),
buffer
(
_buffer
),
buffer_before_play
(
pc
.
buffered_before_play
),
decoder_wakeup_threshold
(
buffer
.
GetSize
()
*
3
/
4
)
{
}
...
...
@@ -954,7 +961,7 @@ Player::Run() noexcept
until the buffer is large enough, to
prevent stuttering on slow machines */
if
(
pipe
->
GetSize
()
<
pc
.
buffered
_before_play
&&
if
(
pipe
->
GetSize
()
<
buffer
_before_play
&&
!
dc
.
IsIdle
()
&&
!
buffer
.
IsFull
())
{
/* not enough decoded buffer space yet */
...
...
@@ -1002,7 +1009,7 @@ Player::Run() noexcept
dc
.
out_audio_format
,
play_audio_format
,
buffer
.
GetSize
()
-
pc
.
buffered
_before_play
);
buffer
_before_play
);
if
(
cross_fade_chunks
>
0
)
xfade_state
=
CrossFadeState
::
ENABLED
;
else
...
...
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