From 49ce700a2782784af431e1b1734d53fb551fe5c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Axelsson?= Date: Tue, 6 Nov 2007 16:19:09 +0000 Subject: [PATCH] =?utf8?q?Allow=20propagation=20of=20stream=20selection=20?= =?utf8?q?through=20the=20ASF=20demuxer=20to=20the=20MMSH=20protocol=20han?= =?utf8?q?dler.=20Patch=20by=20Bj=C3=B6rn=20Axelsson:=20bjorn=20;=20axelss?= =?utf8?q?on=20=C2=A7=20intinor=20:=20se=20Original=20thread:=20[FFmpeg-de?= =?utf8?q?vel]=20[PATCH]=20MMSH=20stream=20selection=20support=20for=20asf?= =?utf8?q?=20demuxer=20Date:=2011/02/2007=2011:51=20AM?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 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 7b1ad67..56272d9 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: -- 2.7.4