[MPlayer-dev-eng] Re: [PATCH] of asf_mmst_streaming to only receive the resquested streams

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Jan 18 20:03:10 CET 2005


Hi,
> On Tue, Jan 18, 2005 at 10:25:42AM +0100, Reimar D?ffinger wrote:
> > > In this case, it would be nice to add a command line option
> > > "-send-unwanted-channels" to be used when you don't want the server
> > > to send everything.
> > 
> > I think there is a misunderstanding. The patch sets a flag to 0x2 for unwanted streams (saying something like "request to disable that stream"). From my experience many servers do not treat this correctly.
> > Instead of sending "request to disable that stream" nothing should be sent to the server for these IMHO.
> 
> OK Many servers do not treat this correctly and would be confused with this send, 
> but there is at least one server which treats this correctly.

I do believe you that this is an improvement (but nevertheless mms
support is hopelessly broken atm).
Please tell me if the attached patch works for you, too. I think it
should work with more servers (sorry, untested).
Btw.: Can you try the URL with http:// instead of mms:// ? If it works
it has the advantage that you can use -bandwidth in stead of explicitly
setting vid and aid. You need latest CVS of course ;-)

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libmpdemux/asf_mmst_streaming.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/asf_mmst_streaming.c,v
retrieving revision 1.26
diff -u -r1.26 asf_mmst_streaming.c
--- libmpdemux/asf_mmst_streaming.c	15 Dec 2004 19:12:46 -0000	1.26
+++ libmpdemux/asf_mmst_streaming.c	18 Jan 2005 19:02:17 -0000
@@ -484,6 +487,9 @@
 	streaming_ctrl=NULL;
 }
 
+extern int audio_id;
+extern int video_id;
+
 int asf_mmst_streaming_start(stream_t *stream)
 {
   char                 str[1024];
@@ -491,6 +497,7 @@
   uint8_t              asf_header[HDR_BUF_SIZE];
   int                  asf_header_len;
   int                  len, i, packet_length;
+  int requested_stream_cnt;
   char                *path, *unescpath;
   URL_t *url1 = stream->streaming_ctrl->url;
   int s = stream->fd;
@@ -606,13 +613,17 @@
   memset (data, 0, 40);
 
   for (i=1; i<num_stream_ids; i++) {
-    data [ (i-1) * 6 + 2 ] = 0xFF;
-    data [ (i-1) * 6 + 3 ] = 0xFF;
-    data [ (i-1) * 6 + 4 ] = stream_ids[i];
-    data [ (i-1) * 6 + 5 ] = 0x00;
+    if (video_id > 0 && audio_id > 0 &&
+         stream_ids[i] != video_id && stream_ids[i] != audio_id)
+      continue;
+    data [ requested_stream_cnt * 6 + 2 ] = 0xFF;
+    data [ requested_stream_cnt * 6 + 3 ] = 0xFF;
+    data [ requested_stream_cnt * 6 + 4 ] = stream_ids[i];
+    data [ requested_stream_cnt * 6 + 5 ] = 0x00;
+    requested_stream_cnt++;
   }
 
-  send_command (s, 0x33, num_stream_ids, 0xFFFF | stream_ids[0] << 16, (num_stream_ids-1)*6+2 , data);
+  send_command (s, 0x33, requested_stream_cnt, 0xFFFF | stream_ids[0] << 16, (num_stream_ids-1)*6+2 , data);
 
   get_answer (s);
 


More information about the MPlayer-dev-eng mailing list