From 6f3d70b5e24cebbd6fd8c3a665a801628ef912ff Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 27 Jan 2013 17:20:50 +0100 Subject: DecoderControl, InputStream: use Mutex/Cond instead of GMutex/GCond --- src/TagFile.cxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/TagFile.cxx') 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; } -- cgit v1.2.3