1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-11 09:29:29 +00:00

Preserve unsv:// protocol specifier over http redirects.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25266 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2007-12-02 18:24:01 +00:00
parent 8d5573a14e
commit 15cddcd511

View File

@ -836,6 +836,7 @@ static int http_streaming_start(stream_t *stream, int* file_format) {
// TODO: RFC 2616, recommand to detect infinite redirection loops
next_url = http_get_field( http_hdr, "Location" );
if( next_url!=NULL ) {
int is_ultravox = strcasecmp(stream->streaming_ctrl->url->protocol, "unsv") == 0;
stream->streaming_ctrl->url = url_redirect( &url, next_url );
if (!strcasecmp(url->protocol, "mms")) {
res = STREAM_REDIRECTED;
@ -845,6 +846,10 @@ static int http_streaming_start(stream_t *stream, int* file_format) {
mp_msg(MSGT_NETWORK,MSGL_ERR,"Unsupported http %d redirect to %s protocol\n", http_hdr->status_code, url->protocol);
goto err_out;
}
if (is_ultravox) {
free(url->protocol);
url->protocol = strdup("unsv");
}
redirect = 1;
}
break;