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
77af999b
Commit
77af999b
authored
Apr 05, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/Thread: use DecoderBridge::OpenUri(), eliminate duplicate code
parent
4926763f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
33 deletions
+1
-33
Thread.cxx
src/decoder/Thread.cxx
+1
-33
No files found.
src/decoder/Thread.cxx
View file @
77af999b
...
@@ -47,38 +47,6 @@
...
@@ -47,38 +47,6 @@
static
constexpr
Domain
decoder_thread_domain
(
"decoder_thread"
);
static
constexpr
Domain
decoder_thread_domain
(
"decoder_thread"
);
/**
* Opens the input stream with InputStream::Open(), and waits until
* the stream gets ready.
*
* Unlock the decoder before calling this function.
*/
static
InputStreamPtr
decoder_input_stream_open
(
DecoderControl
&
dc
,
const
char
*
uri
)
{
auto
is
=
InputStream
::
Open
(
uri
,
dc
.
mutex
);
is
->
SetHandler
(
&
dc
);
/* wait for the input stream to become ready; its metadata
will be available then */
const
std
::
lock_guard
<
Mutex
>
protect
(
dc
.
mutex
);
is
->
Update
();
while
(
!
is
->
IsReady
())
{
if
(
dc
.
command
==
DecoderCommand
::
STOP
)
throw
StopDecoder
();
dc
.
Wait
();
is
->
Update
();
}
is
->
Check
();
return
is
;
}
static
InputStreamPtr
static
InputStreamPtr
decoder_input_stream_open
(
DecoderControl
&
dc
,
Path
path
)
decoder_input_stream_open
(
DecoderControl
&
dc
,
Path
path
)
{
{
...
@@ -286,7 +254,7 @@ decoder_run_stream(DecoderBridge &bridge, const char *uri)
...
@@ -286,7 +254,7 @@ decoder_run_stream(DecoderBridge &bridge, const char *uri)
{
{
DecoderControl
&
dc
=
bridge
.
dc
;
DecoderControl
&
dc
=
bridge
.
dc
;
auto
input_stream
=
decoder_input_stream_open
(
dc
,
uri
);
auto
input_stream
=
bridge
.
OpenUri
(
uri
);
assert
(
input_stream
);
assert
(
input_stream
);
MaybeLoadReplayGain
(
bridge
,
*
input_stream
);
MaybeLoadReplayGain
(
bridge
,
*
input_stream
);
...
...
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