changeset 2708:046577e618bd libavformat

Allow propagation of stream selection through the ASF demuxer to the 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
author benoit
date Tue, 06 Nov 2007 16:19:09 +0000
parents 0199fcbb9d23
children 8f923b7f5462
files asf.c
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/asf.c	Tue Nov 06 16:02:33 2007 +0000
+++ b/asf.c	Tue Nov 06 16:19:09 2007 +0000
@@ -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 @@
 }
 #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 @@
         }
     }
 
+#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: