summaryrefslogtreecommitdiff
path: root/plugins/converter/converter.c
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/converter/converter.c
parent816d87e1d38dc0fecbe1fa47794b2d7a18d2e321 (diff)
fixed remaining pl_find_meta calls lacking pl_lock
Diffstat (limited to 'plugins/converter/converter.c')
-rw-r--r--plugins/converter/converter.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/converter/converter.c b/plugins/converter/converter.c
index 7c884eb1..ad68bab9 100644
--- a/plugins/converter/converter.c
+++ b/plugins/converter/converter.c
@@ -685,7 +685,9 @@ get_output_field (DB_playItem_t *it, const char *field, char *out, int sz)
void
get_output_path (DB_playItem_t *it, const char *outfolder_user, const char *outfile, ddb_encoder_preset_t *encoder_preset, int preserve_folder_structure, const char *root_folder, int write_to_source_folder, char *out, int sz) {
trace ("get_output_path: %s %s %s\n", outfolder_user, outfile, root_folder);
+ deadbeef->pl_lock ();
const char *uri = strdupa (deadbeef->pl_find_meta (it, ":URI"));
+ deadbeef->pl_unlock ();
char outfolder_preserve[2000];
if (preserve_folder_structure) {
// generate new outfolder
@@ -800,8 +802,7 @@ int
convert (DB_playItem_t *it, const char *out, int output_bps, int output_is_float, ddb_encoder_preset_t *encoder_preset, ddb_dsp_preset_t *dsp_preset, int *abort) {
if (deadbeef->pl_get_item_duration (it) <= 0) {
deadbeef->pl_lock ();
- const char *fname = deadbeef->pl_find_meta (it, ":URI");
- fprintf (stderr, "converter: stream %s doesn't have finite length, skipped\n", fname);
+ fprintf (stderr, "converter: stream %s doesn't have finite length, skipped\n", deadbeef->pl_find_meta (it, ":URI"));
deadbeef->pl_unlock ();
return -1;
}
@@ -812,7 +813,9 @@ convert (DB_playItem_t *it, const char *out, int output_bps, int output_is_float
DB_decoder_t *dec = NULL;
DB_fileinfo_t *fileinfo = NULL;
char input_file_name[PATH_MAX] = "";
+ deadbeef->pl_lock ();
dec = (DB_decoder_t *)deadbeef->plug_get_for_id (deadbeef->pl_find_meta (it, ":DECODER"));
+ deadbeef->pl_unlock ();
if (dec) {
fileinfo = dec->open (0);