diff options
author | Viktor Semykin <thesame.ml@gmail.com> | 2010-04-06 22:19:35 +0300 |
---|---|---|
committer | Viktor Semykin <thesame.ml@gmail.com> | 2010-04-06 22:19:35 +0300 |
commit | 823669afef8942b45960391f2f3d732ab1ad06e3 (patch) | |
tree | 067ad15823314a39d5c9d15878c9367b826bccac /plugins/vfs_curl/vfs_curl.c | |
parent | 6dbd7dd11bccc0ce7507e7b4b195517f123e8694 (diff) | |
parent | 9c6e2108adbcedccee5a2984b1d8ffc57e6b1087 (diff) |
Merge branch 'devel' of git://deadbeef.git.sourceforge.net/gitroot/deadbeef/deadbeef into eq
Diffstat (limited to 'plugins/vfs_curl/vfs_curl.c')
-rw-r--r-- | plugins/vfs_curl/vfs_curl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/vfs_curl/vfs_curl.c b/plugins/vfs_curl/vfs_curl.c index 517d55ce..c376b2ed 100644 --- a/plugins/vfs_curl/vfs_curl.c +++ b/plugins/vfs_curl/vfs_curl.c @@ -76,6 +76,7 @@ static char http_err[CURL_ERROR_SIZE]; static int vfs_curl_abort; static int vfs_curl_count; +static int allow_new_streams; static size_t http_content_header_handler (void *ptr, size_t size, size_t nmemb, void *stream); @@ -518,6 +519,9 @@ http_start_streamer (HTTP_FILE *fp) { static DB_FILE * http_open (const char *fname) { + if (!allow_new_streams) { + return NULL; + } trace ("http_open\n"); HTTP_FILE *fp = malloc (sizeof (HTTP_FILE)); memset (fp, 0, sizeof (HTTP_FILE)); @@ -805,12 +809,14 @@ vfs_curl_on_abort (DB_event_t *ev, uintptr_t data) { static int vfs_curl_start (void) { deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_ABORTREAD, DB_CALLBACK (vfs_curl_on_abort), 0); + allow_new_streams = 1; return 0; } static int vfs_curl_stop (void) { deadbeef->ev_unsubscribe (DB_PLUGIN (&plugin), DB_EV_ABORTREAD, DB_CALLBACK (vfs_curl_on_abort), 0); + allow_new_streams = 0; vfs_curl_on_abort (NULL, 0); return 0; } |