else
av_free(content);
+ if (rt->seq != reply->seq) {
+ av_log(s, AV_LOG_WARNING, "CSeq %d expected, %d received.\n",
+ rt->seq, reply->seq);
+ }
+
/* EOS */
if (reply->notice == 2101 /* End-of-Stream Reached */ ||
reply->notice == 2104 /* Start-of-Stream Reached */ ||
const char *cmd, RTSPMessageHeader *reply,
unsigned char **content_ptr)
{
- ff_rtsp_send_cmd_async(s, cmd);
-
- ff_rtsp_read_reply(s, reply, content_ptr, 0);
+ ff_rtsp_send_cmd_with_content(s, cmd, reply, content_ptr, NULL, 0);
}
void ff_rtsp_send_cmd_with_content(AVFormatContext *s,
port = RTSP_DEFAULT_PORT;
/* search for options */
- option_list = strchr(path, '?');
+ option_list = strrchr(path, '?');
if (option_list) {
/* Strip out the RTSP specific options, write out the rest of
* the options back into the same string. */
/* handle the options */
if (!strcmp(option, "udp")) {
- lower_transport_mask = (1<< RTSP_LOWER_TRANSPORT_UDP);
+ lower_transport_mask |= (1<< RTSP_LOWER_TRANSPORT_UDP);
} else if (!strcmp(option, "multicast")) {
- lower_transport_mask = (1<< RTSP_LOWER_TRANSPORT_UDP_MULTICAST);
+ lower_transport_mask |= (1<< RTSP_LOWER_TRANSPORT_UDP_MULTICAST);
} else if (!strcmp(option, "tcp")) {
- lower_transport_mask = (1<< RTSP_LOWER_TRANSPORT_TCP);
+ lower_transport_mask |= (1<< RTSP_LOWER_TRANSPORT_TCP);
} else {
/* Write options back into the buffer, using memmove instead
* of strcpy since the strings may overlap. */
if (tcp_fd != -1 && FD_ISSET(tcp_fd, &rfds)) {
RTSPMessageHeader reply;
- ff_rtsp_read_reply(s, &reply, NULL, 0);
+ ret = ff_rtsp_read_reply(s, &reply, NULL, 0);
+ if (ret < 0)
+ return ret;
/* XXX: parse message */
if (rt->state != RTSP_STATE_STREAMING)
return 0;