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/tta | |
parent | 816d87e1d38dc0fecbe1fa47794b2d7a18d2e321 (diff) |
fixed remaining pl_find_meta calls lacking pl_lock
Diffstat (limited to 'plugins/tta')
-rw-r--r-- | plugins/tta/ttaplug.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/plugins/tta/ttaplug.c b/plugins/tta/ttaplug.c index 5b433e44..cb6f35f7 100644 --- a/plugins/tta/ttaplug.c +++ b/plugins/tta/ttaplug.c @@ -61,16 +61,21 @@ static int tta_init (DB_fileinfo_t *_info, DB_playItem_t *it) { tta_info_t *info = (tta_info_t *)_info; - trace ("open_tta_file %s\n", deadbeef->pl_find_meta (it, ":URI")); - if (open_tta_file (deadbeef->pl_find_meta (it, ":URI"), &info->tta, 0) != 0) { - fprintf (stderr, "tta: failed to open %s\n", deadbeef->pl_find_meta (it, ":URI")); + deadbeef->pl_lock (); + const char *fname = deadbeef->pl_find_meta (it, ":URI") + trace ("open_tta_file %s\n", fname); + if (open_tta_file (fname, &info->tta, 0) != 0) { + deadbeef->pl_unlock (); + fprintf (stderr, "tta: failed to open %s\n", fname); return -1; } if (player_init (&info->tta) != 0) { - fprintf (stderr, "tta: failed to init player for %s\n", deadbeef->pl_find_meta (it, ":URI")); + deadbeef->pl_unlock (); + fprintf (stderr, "tta: failed to init player for %s\n", fname); return -1; } + deadbeef->pl_unlock (); _info->fmt.bps = info->tta.BPS; _info->fmt.channels = info->tta.NCH; @@ -251,7 +256,9 @@ tta_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { } static int tta_read_metadata (DB_playItem_t *it) { + deadbeef->pl_lock (); DB_FILE *fp = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI")); + deadbeef->pl_unlock (); if (!fp) { return -1; } |