diff options
author | waker <wakeroid@gmail.com> | 2011-04-25 21:49:34 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-04-25 21:49:34 +0200 |
commit | 43a277e9d2dfaa2055184617495e1d3a48b8d9cc (patch) | |
tree | 6e98e5d4df0299825c6ec21ca51c37ca23ccf9d2 /plugins/vfs_curl | |
parent | 3d8f7348c65f7b071ad488c6d09ecfa6e3baaee6 (diff) |
new future-proof playlist API, potentially reducing locking, and allowing more flexibility
Diffstat (limited to 'plugins/vfs_curl')
-rw-r--r-- | plugins/vfs_curl/vfs_curl.c | 12 |
1 files changed, 10 insertions, 2 deletions
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); } |