DecoderControl, InputStream: use Mutex/Cond instead of GMutex/GCond

This commit is contained in:
Max Kellermann
2013-01-27 17:20:50 +01:00
parent 257a0dee75
commit 6f3d70b5e2
46 changed files with 182 additions and 234 deletions

View File

@@ -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;
}