diff options
author | Max Kellermann <max@duempel.org> | 2009-11-07 15:24:38 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-11-07 15:24:38 +0100 |
commit | f2184db1cd559085abdc98e3942521fdb115077d (patch) | |
tree | 77d6bcdf257ad4914ee89d7b9781610899886146 | |
parent | 41f3f12709a989e9f6691b77aa0e0e8abefbd415 (diff) | |
download | mpd-f2184db1cd559085abdc98e3942521fdb115077d.tar.gz mpd-f2184db1cd559085abdc98e3942521fdb115077d.tar.xz mpd-f2184db1cd559085abdc98e3942521fdb115077d.zip |
decoder_thread: added local variable "dc" in decoder_run_file()
Simplify the expressions.
-rw-r--r-- | src/decoder_thread.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/decoder_thread.c b/src/decoder_thread.c index 1e850a037..a4d599080 100644 --- a/src/decoder_thread.c +++ b/src/decoder_thread.c @@ -210,39 +210,40 @@ decoder_run_stream(struct decoder *decoder, const char *uri) static bool decoder_run_file(struct decoder *decoder, const char *path_fs) { + struct decoder_control *dc = decoder->dc; const char *suffix = uri_get_suffix(path_fs); const struct decoder_plugin *plugin = NULL; if (suffix == NULL) return false; - decoder_unlock(decoder->dc); + decoder_unlock(dc); while ((plugin = decoder_plugin_from_suffix(suffix, plugin)) != NULL) { if (plugin->file_decode != NULL) { - decoder_lock(decoder->dc); + decoder_lock(dc); if (decoder_file_decode(plugin, decoder, path_fs)) return true; - decoder_unlock(decoder->dc); + decoder_unlock(dc); } else if (plugin->stream_decode != NULL) { struct input_stream input_stream; if (!input_stream_open(&input_stream, path_fs)) continue; - decoder_lock(decoder->dc); + decoder_lock(dc); if (decoder_stream_decode(plugin, decoder, &input_stream)) return true; - decoder_unlock(decoder->dc); + decoder_unlock(dc); } } - decoder_lock(decoder->dc); + decoder_lock(dc); return false; } |