diff options
author | Rudolf Polzer <divverent@xonotic.org> | 2013-01-10 14:11:26 +0100 |
---|---|---|
committer | Rudolf Polzer <divverent@xonotic.org> | 2013-01-10 14:11:26 +0100 |
commit | 944be9d24bbf748ce65feda44e8df75fd1950bc6 (patch) | |
tree | 0ebd2d3cc656820f089aef32b7cbd8127340f0d6 /core/quvi.c | |
parent | 7c40d8a36ef48ca7216e3d8f4eddf19e70d419e5 (diff) |
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.
Diffstat (limited to 'core/quvi.c')
-rw-r--r-- | core/quvi.c | 14 |
1 files changed, 12 insertions, 2 deletions
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); |