From 944be9d24bbf748ce65feda44e8df75fd1950bc6 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Thu, 10 Jan 2013 14:11:26 +0100 Subject: Fix lots of bugs in mp_http URL handling Many instances of "http" were not changed to "mp_http", which made many aspects of the mp_http protocol handler broken. --- core/quvi.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/quvi.c b/core/quvi.c index 697b3736d4..e300e2dd03 100644 --- a/core/quvi.c +++ b/core/quvi.c @@ -26,12 +26,18 @@ struct mp_resolve_result *mp_resolve_quvi(const char *url, struct MPOpts *opts) { QUVIcode rc; + bool mp_url = false; quvi_t q; rc = quvi_init(&q); if (rc != QUVI_OK) return NULL; + if (!strncmp(url, "mp_", 3)) { + url += 3; + mp_url = true; + } + // Don't try to use quvi on an URL that's not directly supported, since // quvi will do a network access anyway in order to check for HTTP // redirections etc. @@ -65,8 +71,12 @@ struct mp_resolve_result *mp_resolve_quvi(const char *url, struct MPOpts *opts) char *val; - if (quvi_getprop(m, QUVIPROP_MEDIAURL, &val) == QUVI_OK) - result->url = talloc_strdup(result, val); + if (quvi_getprop(m, QUVIPROP_MEDIAURL, &val) == QUVI_OK) { + if (mp_url) + result->url = talloc_asprintf(result, "mp_%s", val); + else + result->url = talloc_strdup(result, val); + } if (quvi_getprop(m, QUVIPROP_PAGETITLE, &val) == QUVI_OK) result->title = talloc_strdup(result, val); -- cgit v1.2.3