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

daurat daurat at tiscali.fr
Mon Jan 17 18:32:46 CET 2005


Dear developpers of mplayer,

Everything is in the subject.
This patch is useful for TCP MMS streams which have many video
streams (usually with different bitrates).
The current version of mplayer asks for all the streams, and
then selects the good one for display.

With this patch IF you specify the audio AND the video stream
then only these two are transmitted.

Example:
$ mplayer -v -cache mmst://.... 
....
 stream count=[0x4][4]
   stream id=[0x1][1]
   max bitrate=[0x10332][66354]
   stream id=[0x2][2]
   max bitrate=[0x11572a][1136426]
   stream id=[0x3][3]
   max bitrate=[0x9b60a][636426]
   stream id=[0x4][4]
   max bitrate=[0x4958a][300426]
...
## takes 2Mbit/s... too much for me
$ mplayer -cache 8192 -aid 1 -vid 4 "mmst://....."
##takes only 360 Kbit/s (WITH the patch)

(To make this patch, I have looked a little to the xine source:
http://cvs.sourceforge.net/viewcvs.py/xine/xine-lib/src/input/mms.c?rev=HEAD )


Alain


-------------- 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	17 Jan 2005 17:28:37 -0000
@@ -484,6 +484,9 @@
 	streaming_ctrl=NULL;
 }
 
+extern int audio_id;
+extern int video_id;
+
 int asf_mmst_streaming_start(stream_t *stream)
 {
   char                 str[1024];
@@ -610,6 +613,9 @@
     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)
+      data [ (i-1) * 6 + 6 ] = 0x02;
   }
 
   send_command (s, 0x33, num_stream_ids, 0xFFFF | stream_ids[0] << 16, (num_stream_ids-1)*6+2 , data);


More information about the MPlayer-dev-eng mailing list