54 static pthread_mutex_t
mutex = PTHREAD_MUTEX_INITIALIZER;
55 static pthread_cond_t
cond = PTHREAD_COND_INITIALIZER;
81 pthread_mutex_lock (&
mutex);
83 GQueue queue = G_QUEUE_INIT;
88 g_hash_table_iter_init (& iter,
art_items);
89 while (g_hash_table_iter_next (& iter, & ptr1, & ptr2))
96 g_queue_push_tail (& queue,
str_ref (file));
107 pthread_mutex_unlock (&
mutex);
109 char * current =
NULL;
114 while ((file = g_queue_pop_head (& queue)))
118 if (current && ! strcmp (file, current))
136 pthread_mutex_lock (&
mutex);
140 assert (item !=
NULL && ! item->
flag);
149 pthread_cond_broadcast (&
cond);
150 pthread_mutex_unlock (&
mutex);
157 if (item && item->
flag)
201 art_items = g_hash_table_new_full (g_str_hash, g_str_equal,
231 pthread_mutex_lock (&
mutex);
250 pthread_mutex_unlock (&
mutex);
255 const char * art_file =
NULL;
256 pthread_mutex_lock (&
mutex);
280 pthread_mutex_unlock (&
mutex);
294 void art_get_data (
const char * file,
const void * * data, int64_t * len)
296 fprintf (stderr,
"aud_art_get_data() is deprecated. Use "
297 "aud_art_request_data() instead.\n");
303 fprintf (stderr,
"aud_art_get_file() is deprecated. Use "
304 "aud_art_request_file() instead.\n");
310 pthread_mutex_lock (&
mutex);
313 assert (item !=
NULL);
317 pthread_mutex_unlock (&
mutex);
void art_get_data(const char *file, const void **data, int64_t *len)
void art_request_data(const char *file, const void **data, int64_t *len)
char * write_temp_file(void *data, int64_t len)
static void art_item_free(ArtItem *item)
EXPORT char * uri_to_filename(const char *uri)
const char * art_get_file(const char *file)
const char * scan_request_get_filename(ScanRequest *request)
void art_get_data_real(const char *file, const void **data, int64_t *len, bool_t blocking)
char * playback_entry_get_filename(void)
void(* HookFunction)(void *data, void *user)
EXPORT void hook_associate(const char *name, HookFunction func, void *user)
static void release_current(void)
#define hook_dissociate(n, f)
char * str_ref(char *str)
void art_unref(const char *file)
static char * current_ref
ScanRequest * scan_request(const char *filename, int flags, PluginHandle *decoder, ScanCallback callback)
void scan_request_get_image_data(ScanRequest *request, void **data, int64_t *len)
static ArtItem * art_item_get(const char *file, bool_t blocking)
static void request_callback(ScanRequest *request)
static GHashTable * art_items
void str_unref(char *str)
static pthread_cond_t cond
void vfs_file_get_contents(const char *filename, void **buf, int64_t *size)
Gets contents of the file into a buffer.
char * scan_request_get_image_file(ScanRequest *request)
static pthread_mutex_t mutex
EXPORT void hook_call(const char *name, void *data)
static void art_item_unref(const char *file, ArtItem *item)
static bool_t send_requests(void *unused)
EXPORT char * filename_to_uri(const char *name)
const char * art_request_file(const char *file)
const char * art_get_file_real(const char *file, bool_t blocking)
char * str_get(const char *str)