diff options
author | Luca Abeni <lucabe72@email.it> | 2007-11-29 08:35:05 +0000 |
---|---|---|
committer | Luca Abeni <lucabe72@email.it> | 2007-11-29 08:35:05 +0000 |
commit | e8acf0edeae0b5ef53233c49015b07cc9711f20c (patch) | |
tree | b60038220c76845bd7fb511d8bdb96871a2eb1e0 /libavformat/rtsp.c | |
parent | fe2b276c2ed6463f3e0db859a10b71addd839cd8 (diff) | |
download | ffmpeg-streaming-e8acf0edeae0b5ef53233c49015b07cc9711f20c.zip ffmpeg-streaming-e8acf0edeae0b5ef53233c49015b07cc9711f20c.tar.gz |
Suppress the "redirector hack" from libavformat/utils.c:av_open_input_stream(),
and implement the redirector format more properly.
Originally committed as revision 11112 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r-- | libavformat/rtsp.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 831ef9b..9af572d 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1435,12 +1435,12 @@ static int redir_probe(AVProbeData *pd) return 0; } -/* called from utils.c */ -int redir_open(AVFormatContext **ic_ptr, ByteIOContext *f) +static int redir_read_header(AVFormatContext *s, AVFormatParameters *ap) { char buf[4096], *q; int c; AVFormatContext *ic = NULL; + ByteIOContext *f = s->pb; /* parse each URL and try to open it */ c = url_fgetc(f); @@ -1468,11 +1468,13 @@ int redir_open(AVFormatContext **ic_ptr, ByteIOContext *f) if (av_open_input_file(&ic, buf, NULL, 0, NULL) == 0) break; } - *ic_ptr = ic; if (!ic) return AVERROR(EIO); - else - return 0; + + *s = *ic; + url_fclose(f); + + return 0; } AVInputFormat redir_demuxer = { @@ -1480,7 +1482,7 @@ AVInputFormat redir_demuxer = { "Redirector format", 0, redir_probe, - NULL, + redir_read_header, NULL, NULL, }; |