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
595d1942
Commit
595d1942
authored
Nov 18, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/Internal: rename "chunk" to "current_chunk"
parent
b9059339
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
20 deletions
+19
-20
DecoderAPI.cxx
src/decoder/DecoderAPI.cxx
+7
-7
DecoderInternal.cxx
src/decoder/DecoderInternal.cxx
+10
-11
DecoderInternal.hxx
src/decoder/DecoderInternal.hxx
+1
-1
DecoderThread.cxx
src/decoder/DecoderThread.cxx
+1
-1
No files found.
src/decoder/DecoderAPI.cxx
View file @
595d1942
...
...
@@ -183,7 +183,7 @@ decoder_command_finished(Decoder &decoder)
if
(
decoder
.
initial_seek_running
)
{
assert
(
!
decoder
.
seeking
);
assert
(
decoder
.
chunk
==
nullptr
);
assert
(
decoder
.
c
urrent_c
hunk
==
nullptr
);
assert
(
dc
.
pipe
->
IsEmpty
());
decoder
.
initial_seek_running
=
false
;
...
...
@@ -196,9 +196,9 @@ decoder_command_finished(Decoder &decoder)
/* delete frames from the old song position */
if
(
decoder
.
chunk
!=
nullptr
)
{
dc
.
buffer
->
Return
(
decoder
.
chunk
);
decoder
.
chunk
=
nullptr
;
if
(
decoder
.
c
urrent_c
hunk
!=
nullptr
)
{
dc
.
buffer
->
Return
(
decoder
.
c
urrent_c
hunk
);
decoder
.
c
urrent_c
hunk
=
nullptr
;
}
dc
.
pipe
->
Clear
(
*
dc
.
buffer
);
...
...
@@ -400,13 +400,13 @@ do_send_tag(Decoder &decoder, const Tag &tag)
{
MusicChunk
*
chunk
;
if
(
decoder
.
chunk
!=
nullptr
)
{
if
(
decoder
.
c
urrent_c
hunk
!=
nullptr
)
{
/* there is a partial chunk - flush it, we want the
tag in a new chunk */
decoder
.
FlushChunk
();
}
assert
(
decoder
.
chunk
==
nullptr
);
assert
(
decoder
.
c
urrent_c
hunk
==
nullptr
);
chunk
=
decoder
.
GetChunk
();
if
(
chunk
==
nullptr
)
{
...
...
@@ -620,7 +620,7 @@ decoder_replay_gain(Decoder &decoder,
decoder
.
replay_gain_info
=
*
replay_gain_info
;
decoder
.
replay_gain_serial
=
serial
;
if
(
decoder
.
chunk
!=
nullptr
)
{
if
(
decoder
.
c
urrent_c
hunk
!=
nullptr
)
{
/* flush the current chunk because the new
replay gain values affect the following
samples */
...
...
src/decoder/DecoderInternal.cxx
View file @
595d1942
...
...
@@ -31,7 +31,7 @@
Decoder
::~
Decoder
()
{
/* caller must flush the chunk */
assert
(
chunk
==
nullptr
);
assert
(
c
urrent_c
hunk
==
nullptr
);
if
(
convert
!=
nullptr
)
{
convert
->
Close
();
...
...
@@ -68,17 +68,17 @@ Decoder::GetChunk()
{
DecoderCommand
cmd
;
if
(
chunk
!=
nullptr
)
return
chunk
;
if
(
c
urrent_c
hunk
!=
nullptr
)
return
c
urrent_c
hunk
;
do
{
chunk
=
dc
.
buffer
->
Allocate
();
if
(
chunk
!=
nullptr
)
{
chunk
->
replay_gain_serial
=
replay_gain_serial
;
c
urrent_c
hunk
=
dc
.
buffer
->
Allocate
();
if
(
c
urrent_c
hunk
!=
nullptr
)
{
c
urrent_c
hunk
->
replay_gain_serial
=
replay_gain_serial
;
if
(
replay_gain_serial
!=
0
)
chunk
->
replay_gain_info
=
replay_gain_info
;
c
urrent_c
hunk
->
replay_gain_info
=
replay_gain_info
;
return
chunk
;
return
c
urrent_c
hunk
;
}
cmd
=
LockNeedChunks
(
dc
);
...
...
@@ -93,15 +93,14 @@ Decoder::FlushChunk()
assert
(
!
seeking
);
assert
(
!
initial_seek_running
);
assert
(
!
initial_seek_pending
);
assert
(
chunk
!=
nullptr
);
assert
(
c
urrent_c
hunk
!=
nullptr
);
auto
*
chunk
=
std
::
exchange
(
current_chunk
,
nullptr
);
if
(
chunk
->
IsEmpty
())
dc
.
buffer
->
Return
(
chunk
);
else
dc
.
pipe
->
Push
(
chunk
);
chunk
=
nullptr
;
const
ScopeLock
protect
(
dc
.
mutex
);
if
(
dc
.
client_is_waiting
)
dc
.
client_cond
.
signal
();
...
...
src/decoder/DecoderInternal.hxx
View file @
595d1942
...
...
@@ -78,7 +78,7 @@ struct Decoder {
Tag
*
decoder_tag
=
nullptr
;
/** the chunk currently being written to */
MusicChunk
*
chunk
=
nullptr
;
MusicChunk
*
c
urrent_c
hunk
=
nullptr
;
ReplayGainInfo
replay_gain_info
;
...
...
src/decoder/DecoderThread.cxx
View file @
595d1942
...
...
@@ -385,7 +385,7 @@ decoder_run_song(DecoderControl &dc,
AtScopeExit
(
&
decoder
)
{
/* flush the last chunk */
if
(
decoder
.
chunk
!=
nullptr
)
if
(
decoder
.
c
urrent_c
hunk
!=
nullptr
)
decoder
.
FlushChunk
();
};
...
...
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