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
55e113c7
Commit
55e113c7
authored
Dec 31, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/Thread: document locking rules
parent
b62f5e07
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
DecoderThread.cxx
src/decoder/DecoderThread.cxx
+29
-0
No files found.
src/decoder/DecoderThread.cxx
View file @
55e113c7
...
@@ -120,6 +120,11 @@ decoder_input_stream_open(DecoderControl &dc, Path path)
...
@@ -120,6 +120,11 @@ decoder_input_stream_open(DecoderControl &dc, Path path)
return
is
;
return
is
;
}
}
/**
* Decode a stream with the given decoder plugin.
*
* Caller holds DecoderControl::mutex.
*/
static
bool
static
bool
decoder_stream_decode
(
const
DecoderPlugin
&
plugin
,
decoder_stream_decode
(
const
DecoderPlugin
&
plugin
,
Decoder
&
decoder
,
Decoder
&
decoder
,
...
@@ -155,6 +160,11 @@ decoder_stream_decode(const DecoderPlugin &plugin,
...
@@ -155,6 +160,11 @@ decoder_stream_decode(const DecoderPlugin &plugin,
return
decoder
.
dc
.
state
!=
DecoderState
::
START
;
return
decoder
.
dc
.
state
!=
DecoderState
::
START
;
}
}
/**
* Decode a file with the given decoder plugin.
*
* Caller holds DecoderControl::mutex.
*/
static
bool
static
bool
decoder_file_decode
(
const
DecoderPlugin
&
plugin
,
decoder_file_decode
(
const
DecoderPlugin
&
plugin
,
Decoder
&
decoder
,
Path
path
)
Decoder
&
decoder
,
Path
path
)
...
@@ -258,6 +268,8 @@ decoder_run_stream_fallback(Decoder &decoder, InputStream &is)
...
@@ -258,6 +268,8 @@ decoder_run_stream_fallback(Decoder &decoder, InputStream &is)
/**
/**
* Try decoding a stream.
* Try decoding a stream.
*
* Caller holds DecoderControl::mutex.
*/
*/
static
bool
static
bool
decoder_run_stream
(
Decoder
&
decoder
,
const
char
*
uri
)
decoder_run_stream
(
Decoder
&
decoder
,
const
char
*
uri
)
...
@@ -302,6 +314,12 @@ decoder_load_replay_gain(Decoder &decoder, Path path_fs)
...
@@ -302,6 +314,12 @@ decoder_load_replay_gain(Decoder &decoder, Path path_fs)
decoder_replay_gain
(
decoder
,
&
info
);
decoder_replay_gain
(
decoder
,
&
info
);
}
}
/**
* Decode a file with the given decoder plugin.
*
* DecoderControl::mutex must not be locked by the caller. It will be
* left locked upon returning true.
*/
static
bool
static
bool
TryDecoderFile
(
Decoder
&
decoder
,
Path
path_fs
,
const
char
*
suffix
,
TryDecoderFile
(
Decoder
&
decoder
,
Path
path_fs
,
const
char
*
suffix
,
const
DecoderPlugin
&
plugin
)
const
DecoderPlugin
&
plugin
)
...
@@ -344,6 +362,8 @@ TryDecoderFile(Decoder &decoder, Path path_fs, const char *suffix,
...
@@ -344,6 +362,8 @@ TryDecoderFile(Decoder &decoder, Path path_fs, const char *suffix,
/**
/**
* Try decoding a file.
* Try decoding a file.
*
* Caller holds DecoderControl::mutex.
*/
*/
static
bool
static
bool
decoder_run_file
(
Decoder
&
decoder
,
const
char
*
uri_utf8
,
Path
path_fs
)
decoder_run_file
(
Decoder
&
decoder
,
const
char
*
uri_utf8
,
Path
path_fs
)
...
@@ -369,6 +389,11 @@ decoder_run_file(Decoder &decoder, const char *uri_utf8, Path path_fs)
...
@@ -369,6 +389,11 @@ decoder_run_file(Decoder &decoder, const char *uri_utf8, Path path_fs)
return
false
;
return
false
;
}
}
/**
* Decode a song addressed by a #DetachedSong.
*
* Caller holds DecoderControl::mutex.
*/
static
void
static
void
decoder_run_song
(
DecoderControl
&
dc
,
decoder_run_song
(
DecoderControl
&
dc
,
const
DetachedSong
&
song
,
const
char
*
uri
,
Path
path_fs
)
const
DetachedSong
&
song
,
const
char
*
uri
,
Path
path_fs
)
...
@@ -419,6 +444,10 @@ decoder_run_song(DecoderControl &dc,
...
@@ -419,6 +444,10 @@ decoder_run_song(DecoderControl &dc,
dc
.
client_cond
.
signal
();
dc
.
client_cond
.
signal
();
}
}
/**
*
* Caller holds DecoderControl::mutex.
*/
static
void
static
void
decoder_run
(
DecoderControl
&
dc
)
decoder_run
(
DecoderControl
&
dc
)
{
{
...
...
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