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
65079939
Commit
65079939
authored
Dec 31, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/Thread: move decoder_command_finished_locked() to DecoderControl
parent
f081696f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
20 deletions
+17
-20
DecoderControl.hxx
src/decoder/DecoderControl.hxx
+14
-0
DecoderThread.cxx
src/decoder/DecoderThread.cxx
+3
-20
No files found.
src/decoder/DecoderControl.hxx
View file @
65079939
...
...
@@ -351,6 +351,20 @@ private:
public
:
/**
* Marks the current command as "finished" and notifies the
* client (= player thread).
*
* To be called from the decoder thread. Caller must lock the
* mutex.
*/
void
CommandFinishedLocked
()
{
assert
(
command
!=
DecoderCommand
::
NONE
);
command
=
DecoderCommand
::
NONE
;
client_cond
.
signal
();
}
/**
* Start the decoder.
*
* @param song the song to be decoded; the given instance will be
...
...
src/decoder/DecoderThread.cxx
View file @
65079939
...
...
@@ -45,22 +45,6 @@
static
constexpr
Domain
decoder_thread_domain
(
"decoder_thread"
);
/**
* Marks the current decoder command as "finished" and notifies the
* player thread.
*
* @param dc the #DecoderControl object; must be locked
*/
static
void
decoder_command_finished_locked
(
DecoderControl
&
dc
)
{
assert
(
dc
.
command
!=
DecoderCommand
::
NONE
);
dc
.
command
=
DecoderCommand
::
NONE
;
dc
.
client_cond
.
signal
();
}
/**
* Opens the input stream with InputStream::Open(), and waits until
* the stream gets ready. If a decoder STOP command is received
* during that, it cancels the operation (but does not close the
...
...
@@ -382,8 +366,7 @@ decoder_run_song(DecoderControl &dc,
song
.
IsFile
()
?
new
Tag
(
song
.
GetTag
())
:
nullptr
);
dc
.
state
=
DecoderState
::
START
;
decoder_command_finished_locked
(
dc
);
dc
.
CommandFinishedLocked
();
bool
success
;
{
...
...
@@ -441,7 +424,7 @@ decoder_run(DecoderControl &dc)
path_buffer
=
AllocatedPath
::
FromUTF8
(
uri_utf8
,
dc
.
error
);
if
(
path_buffer
.
IsNull
())
{
dc
.
state
=
DecoderState
::
ERROR
;
d
ecoder_command_finished_locked
(
dc
);
d
c
.
CommandFinishedLocked
(
);
return
;
}
...
...
@@ -487,7 +470,7 @@ decoder_task(void *arg)
break
;
case
DecoderCommand
:
:
STOP
:
d
ecoder_command_finished_locked
(
dc
);
d
c
.
CommandFinishedLocked
(
);
break
;
case
DecoderCommand
:
:
NONE
:
...
...
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