From 49ce700a2782784af431e1b1734d53fb551fe5c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Axelsson?= Date: Tue, 6 Nov 2007 16:19:09 +0000 Subject: [PATCH] =?UTF-8?q?Allow=20propagation=20of=20stream=20selection?= =?UTF-8?q?=20through=20the=20ASF=20demuxer=20to=20the=20MMSH=20protocol?= =?UTF-8?q?=20handler.=20Patch=20by=20Bj=C3=B6rn=20Axelsson:=20bjorn=20;?= =?UTF-8?q?=20axelsson=20=C2=A7=20intinor=20:=20se=20Original=20thread:=20?= =?UTF-8?q?[FFmpeg-devel]=20[PATCH]=20MMSH=20stream=20selection=20support?= =?UTF-8?q?=20for=20asf=20demuxer=20Date:=2011/02/2007=2011:51=20AM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally committed as revision 10935 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/asf.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libavformat/asf.c b/libavformat/asf.c index 7b1ad67804..56272d9fa5 100644 --- a/libavformat/asf.c +++ b/libavformat/asf.c @@ -25,6 +25,8 @@ #include "common.h" #include "asfcrypt.h" +extern void ff_mms_set_stream_selection(URLContext *h, AVFormatContext *format); + #undef NDEBUG #include @@ -106,6 +108,12 @@ static void get_str16(ByteIOContext *pb, char *buf, int buf_size) } #endif +static int is_mms(ByteIOContext *pb) +{ + return url_fileno(pb) && url_fileno(pb)->prot && + !strcmp(url_fileno(pb)->prot->name, "mmsh"); +} + static void get_str16_nolen(ByteIOContext *pb, int len, char *buf, int buf_size) { char* q = buf; @@ -533,6 +541,12 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) } } +#ifdef CONFIG_MMSH_PROTOCOL + /* Give info about ourselves to the mms protocol */ + if(is_mms(pb)) + ff_mms_set_stream_selection(url_fileno(pb), s); +#endif + return 0; fail: