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
dc76eb61
Commit
dc76eb61
authored
Dec 31, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/Thread: mutex not locked for decoder_run_{file,stream}()
parent
55e113c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
DecoderThread.cxx
src/decoder/DecoderThread.cxx
+8
-13
No files found.
src/decoder/DecoderThread.cxx
View file @
dc76eb61
...
...
@@ -269,20 +269,16 @@ decoder_run_stream_fallback(Decoder &decoder, InputStream &is)
/**
* Try decoding a stream.
*
*
Caller holds DecoderControl::mutex
.
*
DecoderControl::mutex is not locked by caller
.
*/
static
bool
decoder_run_stream
(
Decoder
&
decoder
,
const
char
*
uri
)
{
DecoderControl
&
dc
=
decoder
.
dc
;
dc
.
Unlock
();
InputStream
*
input_stream
=
decoder_input_stream_open
(
dc
,
uri
);
if
(
input_stream
==
nullptr
)
{
dc
.
Lock
();
if
(
input_stream
==
nullptr
)
return
false
;
}
dc
.
Lock
();
...
...
@@ -297,7 +293,6 @@ decoder_run_stream(Decoder &decoder, const char *uri)
dc
.
Unlock
();
delete
input_stream
;
dc
.
Lock
();
return
success
;
}
...
...
@@ -363,7 +358,7 @@ TryDecoderFile(Decoder &decoder, Path path_fs, const char *suffix,
/**
* Try decoding a file.
*
*
Caller holds DecoderControl::mutex
.
*
DecoderControl::mutex is not locked by caller
.
*/
static
bool
decoder_run_file
(
Decoder
&
decoder
,
const
char
*
uri_utf8
,
Path
path_fs
)
...
...
@@ -373,7 +368,6 @@ decoder_run_file(Decoder &decoder, const char *uri_utf8, Path path_fs)
return
false
;
DecoderControl
&
dc
=
decoder
.
dc
;
dc
.
Unlock
();
decoder_load_replay_gain
(
decoder
,
path_fs
);
...
...
@@ -382,10 +376,11 @@ decoder_run_file(Decoder &decoder, const char *uri_utf8, Path path_fs)
return
TryDecoderFile
(
decoder
,
path_fs
,
suffix
,
plugin
);
}))
}))
{
dc
.
Unlock
();
return
true
;
}
dc
.
Lock
();
return
false
;
}
...
...
@@ -409,12 +404,12 @@ decoder_run_song(DecoderControl &dc,
decoder_command_finished_locked
(
dc
);
dc
.
Unlock
();
const
int
ret
=
!
path_fs
.
IsNull
()
?
decoder_run_file
(
decoder
,
uri
,
path_fs
)
:
decoder_run_stream
(
decoder
,
uri
);
dc
.
Unlock
();
/* flush the last chunk */
if
(
decoder
.
chunk
!=
nullptr
)
...
...
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