diff options
author | Max Kellermann <max@duempel.org> | 2013-01-27 17:20:50 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-27 18:39:32 +0100 |
commit | 6f3d70b5e24cebbd6fd8c3a665a801628ef912ff (patch) | |
tree | 88ab67b76bac4b88422c3debe7c46d6168a71934 /src/TagFile.cxx | |
parent | 257a0dee758049586efbf0dc3f0339b0cef03456 (diff) |
DecoderControl, InputStream: use Mutex/Cond instead of GMutex/GCond
Diffstat (limited to 'src/TagFile.cxx')
-rw-r--r-- | src/TagFile.cxx | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/TagFile.cxx b/src/TagFile.cxx index edb1f267..f2a88abd 100644 --- a/src/TagFile.cxx +++ b/src/TagFile.cxx @@ -50,8 +50,8 @@ tag_file_scan(const char *path_fs, return false; struct input_stream *is = NULL; - GMutex *mutex = NULL; - GCond *cond = NULL; + Mutex mutex; + Cond cond; do { /* load file tag */ @@ -63,12 +63,9 @@ tag_file_scan(const char *path_fs, if (plugin->scan_stream != NULL) { /* open the input_stream (if not already open) */ - if (is == NULL) { - mutex = g_mutex_new(); - cond = g_cond_new(); + if (is == nullptr) is = input_stream_open(path_fs, mutex, cond, NULL); - } /* now try the stream_tag() method */ if (is != NULL) { @@ -84,11 +81,8 @@ tag_file_scan(const char *path_fs, plugin = decoder_plugin_from_suffix(suffix, plugin); } while (plugin != NULL); - if (is != NULL) { + if (is != NULL) input_stream_close(is); - g_cond_free(cond); - g_mutex_free(mutex); - } return plugin != NULL; } |