# HG changeset patch # User mstorsjo # Date 1269553783 0 # Node ID 59e4df62d61414d9738cb2e75be39d666b49cbdf # Parent f075d373e9bea1ab0d76df2e79368b89c4d8d353 Don't force basic auth in RTSP, but retry with the server-specified method on failure diff -r f075d373e9be -r 59e4df62d614 rtsp.c --- a/rtsp.c Thu Mar 25 21:48:58 2010 +0000 +++ b/rtsp.c Thu Mar 25 21:49:43 2010 +0000 @@ -1060,10 +1060,19 @@ const unsigned char *send_content, int send_content_length) { + RTSPState *rt = s->priv_data; + HTTPAuthType cur_auth_type; + +retry: + cur_auth_type = rt->auth_state.auth_type; ff_rtsp_send_cmd_with_content_async(s, method, url, header, send_content, send_content_length); ff_rtsp_read_reply(s, reply, content_ptr, 0); + + if (reply->status_code == 401 && cur_auth_type == HTTP_AUTH_NONE && + rt->auth_state.auth_type != HTTP_AUTH_NONE) + goto retry; } /** @@ -1447,7 +1456,6 @@ host, sizeof(host), &port, path, sizeof(path), s->filename); if (*auth) { av_strlcpy(rt->auth, auth, sizeof(rt->auth)); - rt->auth_state.auth_type = HTTP_AUTH_BASIC; } if (port < 0) port = RTSP_DEFAULT_PORT;