summaryrefslogtreecommitdiff
path: root/plugins/ao
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-05-17 23:12:00 +0200
committerGravatar waker <wakeroid@gmail.com>2012-05-17 23:12:00 +0200
commit6b97a160c2db19b808cbfc320a8a92da203d49ca (patch)
tree2c3d6594d65d0196c876719120da0d3908c9cbd2 /plugins/ao
parent816d87e1d38dc0fecbe1fa47794b2d7a18d2e321 (diff)
fixed remaining pl_find_meta calls lacking pl_lock
Diffstat (limited to 'plugins/ao')
-rw-r--r--plugins/ao/plugin.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/ao/plugin.c b/plugins/ao/plugin.c
index 2239d995..3743ea72 100644
--- a/plugins/ao/plugin.c
+++ b/plugins/ao/plugin.c
@@ -66,7 +66,9 @@ aoplug_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
_info->plugin = &plugin;
info->duration = deadbeef->pl_get_item_duration (it);
+ deadbeef->pl_lock ();
DB_FILE *file = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI"));
+ deadbeef->pl_unlock ();
if (!file) {
trace ("psf: failed to fopen %s\n", deadbeef->pl_find_meta (it, ":URI"));
return -1;
@@ -81,7 +83,9 @@ aoplug_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
}
if (deadbeef->fread(info->filebuffer, 1, info->filesize, file) != info->filesize) {
+ deadbeef->pl_lock ();
fprintf(stderr, "psf: file read error: %s\n", deadbeef->pl_find_meta (it, ":URI"));
+ deadbeef->pl_unlock ();
deadbeef->fclose (file);
return -1;
}
@@ -93,7 +97,9 @@ aoplug_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
return -1;
}
+ deadbeef->pl_lock ();
info->decoder = ao_start (info->type, deadbeef->pl_find_meta (it, ":URI"), (uint8 *)info->filebuffer, info->filesize);
+ deadbeef->pl_unlock ();
if (!info->decoder) {
fprintf (stderr, "psf: ao_start failed\n");
return -1;