]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Allow propagation of stream selection through the ASF demuxer to the
authorbenoit <benoit@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 6 Nov 2007 16:19:09 +0000 (16:19 +0000)
committerbenoit <benoit@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 6 Nov 2007 16:19:09 +0000 (16:19 +0000)
MMSH protocol handler.
Patch by Björn Axelsson: bjorn ; axelsson § intinor : se
Original thread:
[FFmpeg-devel] [PATCH] MMSH stream selection support for asf demuxer
Date: 11/02/2007 11:51 AM

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@10935 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavformat/asf.c

index 7b1ad67804f211387539b0d05d11c698ccea3eac..56272d9fa5ef259259fe4f39d294f825351c3525 100644 (file)
@@ -25,6 +25,8 @@
 #include "common.h"
 #include "asfcrypt.h"
 
+extern void ff_mms_set_stream_selection(URLContext *h, AVFormatContext *format);
+
 #undef NDEBUG
 #include <assert.h>
 
@@ -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: