diff options
author | waker <wakeroid@gmail.com> | 2011-04-23 14:40:23 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-04-23 14:40:23 +0200 |
commit | f17838a97b2080d65d15c47d23ededad0cae4b27 (patch) | |
tree | 03541deea04d84f449efbbcf794849fdf2d335eb /plugins/notify | |
parent | b5985e32982f2720d0217c55e3f8dc34348608db (diff) |
fixed race condition in notify plugin
Diffstat (limited to 'plugins/notify')
-rw-r--r-- | plugins/notify/notify.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/notify/notify.c b/plugins/notify/notify.c index 9aef30bf..4f184c52 100644 --- a/plugins/notify/notify.c +++ b/plugins/notify/notify.c @@ -195,10 +195,13 @@ cover_avail_callback (const char *fname, const char *artist, const char *album, static void show_notification (DB_playItem_t *track) { char title[1024]; char content[1024]; - deadbeef->conf_lock (); - deadbeef->pl_format_title (track, -1, title, sizeof (title), -1, deadbeef->conf_get_str_fast ("notify.format", NOTIFY_DEFAULT_TITLE)); - deadbeef->pl_format_title (track, -1, content, sizeof (content), -1, deadbeef->conf_get_str_fast ("notify.format_content", NOTIFY_DEFAULT_CONTENT)); - deadbeef->conf_unlock (); + + char format[200]; + char format_content[200]; + deadbeef->conf_get_str ("notify.format", NOTIFY_DEFAULT_TITLE, format, sizeof (format)); + deadbeef->conf_get_str ("notify.format_content", NOTIFY_DEFAULT_CONTENT, format_content, sizeof (format_content)); + deadbeef->pl_format_title (track, -1, title, sizeof (title), -1, format); + deadbeef->pl_format_title (track, -1, content, sizeof (content), -1, format_content); // escape & // char esc_title[1024]; |