diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-06-20 13:18:17 +0100 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-06-20 13:18:17 +0100 |
commit | 17c9a01cbafd5ff0e6645f96f8ac084fbf239e4d (patch) | |
tree | f8bbe29f4b5b0464bdf83ed6cab05497a55955ec /src/input | |
parent | a78cd0f86f650fd566337d9abb86eedc51e3e699 (diff) | |
parent | e8d0ebf629763d195cdc6675f952f479bcedb6c7 (diff) | |
download | xine-lib-17c9a01cbafd5ff0e6645f96f8ac084fbf239e4d.tar.gz xine-lib-17c9a01cbafd5ff0e6645f96f8ac084fbf239e4d.tar.bz2 |
Merge from 1.1.
--HG--
rename : src/input/input_plugin.h => include/xine/input_plugin.h
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/input_http.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/input/input_http.c b/src/input/input_http.c index 2ba92808f..7276ea44a 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -81,6 +81,8 @@ typedef struct { char preview[MAX_PREVIEW_SIZE]; off_t preview_size; + char *mime_type; + char *proto; char *user; char *password; @@ -590,17 +592,20 @@ static const char* http_plugin_get_mrl (input_plugin_t *this_gen) { } static int http_plugin_get_optional_data (input_plugin_t *this_gen, - void *data, int data_type) { + void *const data, int data_type) { + void **const ptr = (void **const) data; http_input_plugin_t *this = (http_input_plugin_t *) this_gen; switch (data_type) { case INPUT_OPTIONAL_DATA_PREVIEW: - memcpy (data, this->preview, this->preview_size); return this->preview_size; - break; + case INPUT_OPTIONAL_DATA_MIME_TYPE: + *ptr = this->mime_type; + case INPUT_OPTIONAL_DATA_DEMUX_MIME_TYPE: + return *this->mime_type ? INPUT_OPTIONAL_SUCCESS : INPUT_OPTIONAL_UNSUPPORTED; } return INPUT_OPTIONAL_UNSUPPORTED; @@ -655,7 +660,9 @@ static int http_plugin_open (input_plugin_t *this_gen ) { int mpegurl_redirect = 0; char auth[BUFSIZE]; char proxyauth[BUFSIZE]; - + char mime_type[256]; + + mime_type[0] = 0; use_proxy = this_class->proxyhost && strlen(this_class->proxyhost); if (use_proxy) { @@ -930,6 +937,7 @@ static int http_plugin_open (input_plugin_t *this_gen ) { const char *type = this->buf + sizeof (TAG_CONTENT_TYPE) - 1; while (isspace (*type)) ++type; + sprintf (mime_type, "%.255s", type); if (!strncasecmp (type, "video/nsv", 9)) { lprintf("shoutcast nsv detected\n"); this->is_nsv = 1; @@ -1005,6 +1013,8 @@ static int http_plugin_open (input_plugin_t *this_gen ) { lprintf("preview_size=%"PRId64"\n", this->preview_size); this->curpos = 0; + if (*mime_type) + this->mime_type = strdup (mime_type); return 1; } |