summaryrefslogtreecommitdiff
path: root/plugins/shn/shn.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/shn/shn.c')
-rw-r--r--plugins/shn/shn.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/shn/shn.c b/plugins/shn/shn.c
index da69866b..cc03ac72 100644
--- a/plugins/shn/shn.c
+++ b/plugins/shn/shn.c
@@ -322,7 +322,9 @@ shn_init(DB_fileinfo_t *_info, DB_playItem_t *it) {
char data[4];
DB_FILE *f;
+ deadbeef->pl_lock ();
f = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI"));
+ deadbeef->pl_unlock ();
if (!f) {
trace ("shn: failed to open %s\n", deadbeef->pl_find_meta (it, ":URI"));
return -1;
@@ -346,10 +348,13 @@ shn_init(DB_fileinfo_t *_info, DB_playItem_t *it) {
return -1;
}
+ deadbeef->pl_lock ();
if (!(info->shnfile = load_shn(deadbeef->pl_find_meta (it, ":URI")))) {
+ deadbeef->pl_unlock ();
trace ("shn: load_shn failed\n");
return -1;
}
+ deadbeef->pl_unlock ();
_info->fmt.bps = info->shnfile->wave_header.bits_per_sample;
_info->fmt.channels = info->shnfile->wave_header.channels;