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
fad0e834
Commit
fad0e834
authored
Dec 31, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/Thread: always unlock mutex before returning from TryDecoderFile()
Remove that surprising rule.
parent
dc76eb61
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
20 deletions
+10
-20
DecoderThread.cxx
src/decoder/DecoderThread.cxx
+10
-20
No files found.
src/decoder/DecoderThread.cxx
View file @
fad0e834
...
@@ -312,8 +312,7 @@ decoder_load_replay_gain(Decoder &decoder, Path path_fs)
...
@@ -312,8 +312,7 @@ decoder_load_replay_gain(Decoder &decoder, Path path_fs)
/**
/**
* Decode a file with the given decoder plugin.
* Decode a file with the given decoder plugin.
*
*
* DecoderControl::mutex must not be locked by the caller. It will be
* DecoderControl::mutex is not locked by caller.
* 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
,
...
@@ -327,10 +326,11 @@ TryDecoderFile(Decoder &decoder, Path path_fs, const char *suffix,
...
@@ -327,10 +326,11 @@ TryDecoderFile(Decoder &decoder, Path path_fs, const char *suffix,
if
(
plugin
.
file_decode
!=
nullptr
)
{
if
(
plugin
.
file_decode
!=
nullptr
)
{
dc
.
Lock
();
dc
.
Lock
();
if
(
decoder_file_decode
(
plugin
,
decoder
,
path_fs
))
bool
success
=
decoder_file_decode
(
plugin
,
decoder
,
path_fs
);
return
true
;
dc
.
Unlock
();
dc
.
Unlock
();
return
success
;
}
else
if
(
plugin
.
stream_decode
!=
nullptr
)
{
}
else
if
(
plugin
.
stream_decode
!=
nullptr
)
{
InputStream
*
input_stream
=
InputStream
*
input_stream
=
decoder_input_stream_open
(
dc
,
path_fs
);
decoder_input_stream_open
(
dc
,
path_fs
);
...
@@ -346,12 +346,8 @@ TryDecoderFile(Decoder &decoder, Path path_fs, const char *suffix,
...
@@ -346,12 +346,8 @@ TryDecoderFile(Decoder &decoder, Path path_fs, const char *suffix,
delete
input_stream
;
delete
input_stream
;
if
(
success
)
{
return
success
;
dc
.
Lock
();
}
else
return
true
;
}
}
return
false
;
return
false
;
}
}
...
@@ -367,21 +363,15 @@ decoder_run_file(Decoder &decoder, const char *uri_utf8, Path path_fs)
...
@@ -367,21 +363,15 @@ decoder_run_file(Decoder &decoder, const char *uri_utf8, Path path_fs)
if
(
suffix
==
nullptr
)
if
(
suffix
==
nullptr
)
return
false
;
return
false
;
DecoderControl
&
dc
=
decoder
.
dc
;
decoder_load_replay_gain
(
decoder
,
path_fs
);
decoder_load_replay_gain
(
decoder
,
path_fs
);
if
(
decoder_plugins_try
([
&
decoder
,
path_fs
,
return
decoder_plugins_try
([
&
decoder
,
path_fs
,
suffix
](
const
DecoderPlugin
&
plugin
){
suffix
](
const
DecoderPlugin
&
plugin
){
return
TryDecoderFile
(
decoder
,
return
TryDecoderFile
(
decoder
,
path_fs
,
suffix
,
path_fs
,
suffix
,
plugin
);
plugin
);
}))
{
});
dc
.
Unlock
();
return
true
;
}
return
false
;
}
}
/**
/**
...
...
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