From 6b97a160c2db19b808cbfc320a8a92da203d49ca Mon Sep 17 00:00:00 2001 From: waker Date: Thu, 17 May 2012 23:12:00 +0200 Subject: fixed remaining pl_find_meta calls lacking pl_lock --- plugins/tta/ttaplug.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'plugins/tta') 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; } -- cgit v1.2.3