diff options
author | waker <wakeroid@gmail.com> | 2012-05-17 23:12:00 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-05-17 23:12:00 +0200 |
commit | 6b97a160c2db19b808cbfc320a8a92da203d49ca (patch) | |
tree | 2c3d6594d65d0196c876719120da0d3908c9cbd2 /plugins/dumb | |
parent | 816d87e1d38dc0fecbe1fa47794b2d7a18d2e321 (diff) |
fixed remaining pl_find_meta calls lacking pl_lock
Diffstat (limited to 'plugins/dumb')
-rw-r--r-- | plugins/dumb/cdumb.c | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/plugins/dumb/cdumb.c b/plugins/dumb/cdumb.c index 26e6fa69..63fb4b18 100644 --- a/plugins/dumb/cdumb.c +++ b/plugins/dumb/cdumb.c @@ -64,13 +64,18 @@ cdumb_init (DB_fileinfo_t *_info, DB_playItem_t *it) { int start_order = 0; int is_dos, is_it; - const char *ext = deadbeef->pl_find_meta (it, ":URI") + strlen (deadbeef->pl_find_meta (it, ":URI")) - 1; - while (*ext != '.' && ext > deadbeef->pl_find_meta (it, ":URI")) { - ext--; + deadbeef->pl_lock (); + { + const char *uri = deadbeef->pl_find_meta (it, ":URI"); + const char *ext = uri + strlen (uri) - 1; + while (*ext != '.' && ext > uri) { + ext--; + } + ext++; + const char *ftype; + info->duh = open_module (uri, ext, &start_order, &is_it, &is_dos, &ftype); } - ext++; - const char *ftype; - info->duh = open_module(deadbeef->pl_find_meta (it, ":URI"), ext, &start_order, &is_it, &is_dos, &ftype); + deadbeef->pl_unlock (); dumb_it_do_initial_runthrough (info->duh); @@ -766,19 +771,25 @@ read_metadata_internal (DB_playItem_t *it, DUMB_IT_SIGDATA *itsd) { static int cdumb_read_metadata (DB_playItem_t *it) { - const char *fname = deadbeef->pl_find_meta (it, ":URI"); - const char *ext = strrchr (fname, '.'); - if (ext) { - ext++; - } - else { - ext = ""; - } + DUH* duh = NULL; int start_order = 0; int is_it; int is_dos; const char *ftype; - DUH* duh = open_module(fname, ext, &start_order, &is_it, &is_dos, &ftype); + + deadbeef->pl_lock (); + { + const char *fname = deadbeef->pl_find_meta (it, ":URI"); + const char *ext = strrchr (fname, '.'); + if (ext) { + ext++; + } + else { + ext = ""; + } + duh = open_module(fname, ext, &start_order, &is_it, &is_dos, &ftype); + } + deadbeef->pl_unlock (); if (!duh) { unload_duh (duh); return -1; |