From 43a277e9d2dfaa2055184617495e1d3a48b8d9cc Mon Sep 17 00:00:00 2001 From: waker Date: Mon, 25 Apr 2011 21:49:34 +0200 Subject: new future-proof playlist API, potentially reducing locking, and allowing more flexibility --- plugins/vfs_curl/vfs_curl.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'plugins/vfs_curl') diff --git a/plugins/vfs_curl/vfs_curl.c b/plugins/vfs_curl/vfs_curl.c index 0ef5cc6a..acb0b561 100644 --- a/plugins/vfs_curl/vfs_curl.c +++ b/plugins/vfs_curl/vfs_curl.c @@ -212,7 +212,11 @@ http_parse_shoutcast_meta (HTTP_FILE *fp, const char *meta, int size) { else { vfs_curl_set_meta (fp->track, "title", title); } - deadbeef->plt_modified (deadbeef->plt_get_handle (deadbeef->plt_get_curr ())); + ddb_playlist_t *plt = deadbeef->plt_get_curr (); + if (plt) { + deadbeef->plt_modified (plt); + deadbeef->plt_unref (plt); + } deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); } return 0; @@ -468,7 +472,11 @@ http_content_header_handler (void *ptr, size_t size, size_t nmemb, void *stream) fp->wait_meta = fp->icy_metaint; } } - deadbeef->plt_modified (deadbeef->plt_get_handle (deadbeef->plt_get_curr ())); + ddb_playlist_t *plt = deadbeef->plt_get_curr (); + if (plt) { + deadbeef->plt_modified (plt); + deadbeef->plt_unref (plt); + } if (refresh_playlist) { deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0); } -- cgit v1.2.3