Revision 1cf151e9

View differences:

libavformat/rtsp.c
1045 1045
    RTSPHeader reply1, *reply = &reply1;
1046 1046
    unsigned char *content = NULL;
1047 1047
    int protocol_mask = 0;
1048
    char real_challenge[64];
1048 1049

  
1049 1050
    /* extract hostname and port */
1050 1051
    url_split(NULL, 0, NULL, 0,
......
1083 1084
    rt->rtsp_hd = rtsp_hd;
1084 1085
    rt->seq = 0;
1085 1086

  
1087
    /* request options supported by the server; this also detects server type */
1088
    for (rt->server_type = RTSP_SERVER_RTP;;) {
1089
        snprintf(cmd, sizeof(cmd),
1090
                 "OPTIONS %s RTSP/1.0\r\n", s->filename);
1091
        if (rt->server_type == RTSP_SERVER_RDT)
1092
            av_strlcat(cmd,
1093
                       /**
1094
                        * The following entries are required for proper
1095
                        * streaming from a Realmedia server. They are
1096
                        * interdependent in some way although we currently
1097
                        * don't quite understand how. Values were copied
1098
                        * from mplayer SVN r23589.
1099
                        * @param CompanyID is a 16-byte ID in base64
1100
                        * @param ClientChallenge is a 16-byte ID in hex
1101
                        */
1102
                       "ClientChallenge: 9e26d33f2984236010ef6253fb1887f7\r\n"
1103
                       "PlayerStarttime: [28/03/2003:22:50:23 00:00]\r\n"
1104
                       "CompanyID: KnKV4M4I/B2FjJ1TToLycw==\r\n"
1105
                       "GUID: 00000000-0000-0000-0000-000000000000\r\n",
1106
                       sizeof(cmd));
1107
        rtsp_send_cmd(s, cmd, reply, NULL);
1108
        if (reply->status_code != RTSP_STATUS_OK) {
1109
            err = AVERROR_INVALIDDATA;
1110
            goto fail;
1111
        }
1112

  
1113
        /* detect server type if not standard-compliant RTP */
1114
        if (rt->server_type != RTSP_SERVER_RDT && reply->real_challenge[0]) {
1115
            rt->server_type = RTSP_SERVER_RDT;
1116
            continue;
1117
        } else if (rt->server_type == RTSP_SERVER_RDT) {
1118
            strcpy(real_challenge, reply->real_challenge);
1119
        }
1120
        break;
1121
    }
1122

  
1086 1123
    /* describe the stream */
1087 1124
    snprintf(cmd, sizeof(cmd),
1088 1125
             "DESCRIBE %s RTSP/1.0\r\n"

Also available in: Unified diff