aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2009-10-24 16:53:06 +0000
committerLuca Barbato <lu_zero@gentoo.org>2009-10-24 16:53:06 +0000
commit921da2174584f50d640b3b785bd4c5f6f6cb224b (patch)
tree2ec12110b4948afe5abaff786cec4290af4856fd
parent7541f32edd8b761c87160bf43ef97b11acb7f720 (diff)
downloadffmpeg-921da2174584f50d640b3b785bd4c5f6f6cb224b.tar.gz
Just remove params understood by the demuxer
This should unbreak certain urls. Originally committed as revision 20364 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/rtsp.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index f92c07afde..c366ff1faa 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1172,7 +1172,8 @@ static int rtsp_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
RTSPState *rt = s->priv_data;
- char host[1024], path[1024], tcpname[1024], cmd[2048], auth[128], *option_list, *option;
+ char host[1024], path[1024], tcpname[1024], cmd[2048], auth[128];
+ char *option_list, *option, *filename;
URLContext *rtsp_hd;
int port, ret, err;
RTSPMessageHeader reply1, *reply = &reply1;
@@ -1199,14 +1200,14 @@ static int rtsp_read_header(AVFormatContext *s,
/* search for options */
option_list = strchr(path, '?');
if (option_list) {
- /* remove the options from the path */
- *option_list++ = 0;
+ filename = strchr(s->filename, '?');
while(option_list) {
/* move the option pointer */
- option = option_list;
+ option = ++option_list;
option_list = strchr(option_list, '&');
if (option_list)
- *(option_list++) = 0;
+ *option_list = 0;
+
/* handle the options */
if (strcmp(option, "udp") == 0)
lower_transport_mask = (1<< RTSP_LOWER_TRANSPORT_UDP);
@@ -1214,12 +1215,13 @@ static int rtsp_read_header(AVFormatContext *s,
lower_transport_mask = (1<< RTSP_LOWER_TRANSPORT_UDP_MULTICAST);
else if (strcmp(option, "tcp") == 0)
lower_transport_mask = (1<< RTSP_LOWER_TRANSPORT_TCP);
+ else {
+ strcpy(++filename, option);
+ filename += strlen(option);
+ if (option_list) *filename = '&';
+ }
}
- // Suppress the options in the filename
- if (option_list = strchr(s->filename, '?')) {
- *option_list = 0;
- dprintf(NULL, "### rtsp_read_header: suppr options:%s\n", s->filename);
- }
+ *filename = 0;
}
if (!lower_transport_mask)