Mercurial > mplayer.hg
annotate libmpdemux/asf_mmst_streaming.c @ 11269:669e67c3d6b3
Red Hat support added by Dominik, README updated.
author | diego |
---|---|
date | Sun, 26 Oct 2003 13:43:26 +0000 |
parents | db6627275cf7 |
children | 007ec48cf146 |
rev | line source |
---|---|
6092 | 1 // mmst implementation taken from the xine-mms plugin made by majormms (http://geocities.com/majormms/) |
2 // | |
3 // ported to mplayer by Abhijeet Phatak <abhijeetphatak@yahoo.com> | |
4 // date : 16 April 2002 | |
5 // | |
6 // information about the mms protocol can be find at http://get.to/sdp | |
7 // | |
8 | |
9 | |
10 #include <stdio.h> | |
11 #include <stdlib.h> | |
12 #include <string.h> | |
13 #include <unistd.h> | |
14 #include <errno.h> | |
7880 | 15 #include <inttypes.h> |
6092 | 16 |
17 #include "config.h" | |
18 | |
10281 | 19 #ifndef HAVE_WINSOCK2 |
20 #define closesocket close | |
21 #else | |
22 #include <winsock2.h> | |
23 #endif | |
24 | |
6092 | 25 #include "url.h" |
26 #include "asf.h" | |
27 | |
28 #include "stream.h" | |
29 | |
30 #include "network.h" | |
31 | |
32 #define BUF_SIZE 102400 | |
33 | |
34 typedef struct | |
35 { | |
36 uint8_t buf[BUF_SIZE]; | |
37 int num_bytes; | |
38 | |
39 } command_t; | |
40 | |
7880 | 41 static int seq_num; |
42 static int num_stream_ids; | |
43 static int stream_ids[20]; | |
6092 | 44 |
45 static int get_data (int s, char *buf, size_t count); | |
46 | |
47 static void put_32 (command_t *cmd, uint32_t value) | |
48 { | |
49 cmd->buf[cmd->num_bytes ] = value % 256; | |
50 value = value >> 8; | |
51 cmd->buf[cmd->num_bytes+1] = value % 256 ; | |
52 value = value >> 8; | |
53 cmd->buf[cmd->num_bytes+2] = value % 256 ; | |
54 value = value >> 8; | |
55 cmd->buf[cmd->num_bytes+3] = value % 256 ; | |
56 | |
57 cmd->num_bytes += 4; | |
58 } | |
59 | |
60 static uint32_t get_32 (unsigned char *cmd, int offset) | |
61 { | |
62 uint32_t ret; | |
63 | |
64 ret = cmd[offset] ; | |
65 ret |= cmd[offset+1]<<8 ; | |
66 ret |= cmd[offset+2]<<16 ; | |
67 ret |= cmd[offset+3]<<24 ; | |
68 | |
69 return ret; | |
70 } | |
71 | |
72 static void send_command (int s, int command, uint32_t switches, | |
73 uint32_t extra, int length, | |
74 char *data) | |
75 { | |
76 command_t cmd; | |
77 int len8; | |
78 | |
11225
48bb1fd37d2a
Fixing tons of 10ls. Patch by rgselk <rgselknospam@yahoo.com>
alex
parents:
10625
diff
changeset
|
79 len8 = (length + 7) / 8; |
6092 | 80 |
81 cmd.num_bytes = 0; | |
82 | |
83 put_32 (&cmd, 0x00000001); /* start sequence */ | |
84 put_32 (&cmd, 0xB00BFACE); /* #-)) */ | |
11225
48bb1fd37d2a
Fixing tons of 10ls. Patch by rgselk <rgselknospam@yahoo.com>
alex
parents:
10625
diff
changeset
|
85 put_32 (&cmd, len8*8 + 32); |
6092 | 86 put_32 (&cmd, 0x20534d4d); /* protocol type "MMS " */ |
87 put_32 (&cmd, len8 + 4); | |
88 put_32 (&cmd, seq_num); | |
89 seq_num++; | |
90 put_32 (&cmd, 0x0); /* unknown */ | |
91 put_32 (&cmd, 0x0); | |
92 put_32 (&cmd, len8+2); | |
93 put_32 (&cmd, 0x00030000 | command); /* dir | command */ | |
94 put_32 (&cmd, switches); | |
95 put_32 (&cmd, extra); | |
96 | |
97 memcpy (&cmd.buf[48], data, length); | |
11225
48bb1fd37d2a
Fixing tons of 10ls. Patch by rgselk <rgselknospam@yahoo.com>
alex
parents:
10625
diff
changeset
|
98 if (length & 7) |
48bb1fd37d2a
Fixing tons of 10ls. Patch by rgselk <rgselknospam@yahoo.com>
alex
parents:
10625
diff
changeset
|
99 memset(&cmd.buf[48 + length], 0, 8 - (length & 7)); |
6092 | 100 |
11225
48bb1fd37d2a
Fixing tons of 10ls. Patch by rgselk <rgselknospam@yahoo.com>
alex
parents:
10625
diff
changeset
|
101 if (send (s, cmd.buf, len8*8+48, 0) != (len8*8+48)) { |
6092 | 102 printf ("write error\n"); |
103 } | |
104 } | |
105 | |
106 static void string_utf16(char *dest, char *src, int len) | |
107 { | |
108 int i; | |
109 | |
110 for (i=0; i<len; i++) { | |
111 dest[i*2] = src[i]; | |
112 dest[i*2+1] = 0; | |
113 } | |
114 | |
11226 | 115 /* trailing zeroes */ |
6092 | 116 dest[i*2] = 0; |
117 dest[i*2+1] = 0; | |
118 } | |
119 | |
120 static void get_answer (int s) | |
121 { | |
122 char data[BUF_SIZE]; | |
123 int command = 0x1b; | |
124 | |
125 while (command == 0x1b) { | |
126 int len; | |
127 | |
10206
35e306346e59
Using recv/send instead read/write for proper MinGW support (it's a 4.2BSD standard). Patch by FloDt <flodt8@yahoo.de>
alex
parents:
10183
diff
changeset
|
128 len = recv (s, data, BUF_SIZE, 0) ; |
6092 | 129 if (!len) { |
130 printf ("\nalert! eof\n"); | |
131 return; | |
132 } | |
133 | |
134 command = get_32 (data, 36) & 0xFFFF; | |
135 | |
136 if (command == 0x1b) | |
137 send_command (s, 0x1b, 0, 0, 0, data); | |
138 } | |
139 } | |
140 | |
141 static int get_data (int s, char *buf, size_t count) | |
142 { | |
7953 | 143 ssize_t len; |
144 size_t total = 0; | |
6092 | 145 |
146 while (total < count) { | |
147 | |
10206
35e306346e59
Using recv/send instead read/write for proper MinGW support (it's a 4.2BSD standard). Patch by FloDt <flodt8@yahoo.de>
alex
parents:
10183
diff
changeset
|
148 len = recv (s, &buf[total], count-total, 0); |
6092 | 149 |
150 if (len<0) { | |
151 perror ("read error:"); | |
152 return 0; | |
153 } | |
154 | |
155 total += len; | |
156 | |
157 if (len != 0) { | |
158 // printf ("[%d/%d]", total, count); | |
159 fflush (stdout); | |
160 } | |
161 | |
162 } | |
163 | |
164 return 1; | |
165 | |
166 } | |
167 | |
168 static int get_header (int s, uint8_t *header, streaming_ctrl_t *streaming_ctrl) | |
169 { | |
170 unsigned char pre_header[8]; | |
7953 | 171 int header_len; |
6092 | 172 |
173 header_len = 0; | |
174 | |
175 while (1) { | |
176 if (!get_data (s, pre_header, 8)) { | |
177 printf ("pre-header read failed\n"); | |
178 return 0; | |
179 } | |
180 if (pre_header[4] == 0x02) { | |
181 | |
182 int packet_len; | |
183 | |
184 packet_len = (pre_header[7] << 8 | pre_header[6]) - 8; | |
185 | |
186 // printf ("asf header packet detected, len=%d\n", packet_len); | |
187 | |
188 if (!get_data (s, &header[header_len], packet_len)) { | |
189 printf ("header data read failed\n"); | |
190 return 0; | |
191 } | |
192 | |
193 header_len += packet_len; | |
194 | |
195 if ( (header[header_len-1] == 1) && (header[header_len-2]==1)) { | |
196 | |
197 | |
198 if( streaming_bufferize( streaming_ctrl, header, header_len )<0 ) { | |
199 return -1; | |
200 } | |
201 | |
202 // printf ("get header packet finished\n"); | |
203 | |
204 return (header_len); | |
205 | |
206 } | |
207 | |
208 } else { | |
209 | |
7953 | 210 int32_t packet_len; |
6092 | 211 int command; |
212 char data[BUF_SIZE]; | |
213 | |
7953 | 214 if (!get_data (s, (char*)&packet_len, 4)) { |
6092 | 215 printf ("packet_len read failed\n"); |
216 return 0; | |
217 } | |
218 | |
7953 | 219 packet_len = get_32 ((unsigned char*)&packet_len, 0) + 4; |
6092 | 220 |
221 // printf ("command packet detected, len=%d\n", packet_len); | |
222 | |
223 if (!get_data (s, data, packet_len)) { | |
224 printf ("command data read failed\n"); | |
225 return 0; | |
226 } | |
227 | |
228 command = get_32 (data, 24) & 0xFFFF; | |
229 | |
230 // printf ("command: %02x\n", command); | |
231 | |
232 if (command == 0x1b) | |
233 send_command (s, 0x1b, 0, 0, 0, data); | |
234 | |
235 } | |
236 | |
237 // printf ("get header packet succ\n"); | |
238 } | |
239 } | |
240 | |
7880 | 241 static int interp_header (uint8_t *header, int header_len) |
6092 | 242 { |
243 int i; | |
7472
c4434bdf6e51
tons of warning fixes, also some 10l bugfixes, including Dominik's PVA bug
arpi
parents:
7309
diff
changeset
|
244 int packet_length=-1; |
6092 | 245 |
246 /* | |
247 * parse header | |
248 */ | |
249 | |
250 i = 30; | |
251 while (i<header_len) { | |
252 | |
253 uint64_t guid_1, guid_2, length; | |
254 | |
255 guid_2 = (uint64_t)header[i] | ((uint64_t)header[i+1]<<8) | |
256 | ((uint64_t)header[i+2]<<16) | ((uint64_t)header[i+3]<<24) | |
257 | ((uint64_t)header[i+4]<<32) | ((uint64_t)header[i+5]<<40) | |
258 | ((uint64_t)header[i+6]<<48) | ((uint64_t)header[i+7]<<56); | |
259 i += 8; | |
260 | |
261 guid_1 = (uint64_t)header[i] | ((uint64_t)header[i+1]<<8) | |
262 | ((uint64_t)header[i+2]<<16) | ((uint64_t)header[i+3]<<24) | |
263 | ((uint64_t)header[i+4]<<32) | ((uint64_t)header[i+5]<<40) | |
264 | ((uint64_t)header[i+6]<<48) | ((uint64_t)header[i+7]<<56); | |
265 i += 8; | |
266 | |
267 // printf ("guid found: %016llx%016llx\n", guid_1, guid_2); | |
268 | |
269 length = (uint64_t)header[i] | ((uint64_t)header[i+1]<<8) | |
270 | ((uint64_t)header[i+2]<<16) | ((uint64_t)header[i+3]<<24) | |
271 | ((uint64_t)header[i+4]<<32) | ((uint64_t)header[i+5]<<40) | |
272 | ((uint64_t)header[i+6]<<48) | ((uint64_t)header[i+7]<<56); | |
273 | |
274 i += 8; | |
275 | |
276 if ( (guid_1 == 0x6cce6200aa00d9a6) && (guid_2 == 0x11cf668e75b22630) ) { | |
277 printf ("header object\n"); | |
278 } else if ((guid_1 == 0x6cce6200aa00d9a6) && (guid_2 == 0x11cf668e75b22636)) { | |
279 printf ("data object\n"); | |
280 } else if ((guid_1 == 0x6553200cc000e48e) && (guid_2 == 0x11cfa9478cabdca1)) { | |
281 | |
282 packet_length = get_32(header, i+92-24); | |
283 | |
284 printf ("file object, packet length = %d (%d)\n", | |
285 packet_length, get_32(header, i+96-24)); | |
286 | |
287 | |
288 } else if ((guid_1 == 0x6553200cc000e68e) && (guid_2 == 0x11cfa9b7b7dc0791)) { | |
289 | |
290 int stream_id = header[i+48] | header[i+49] << 8; | |
291 | |
292 printf ("stream object, stream id: %d\n", stream_id); | |
293 | |
294 stream_ids[num_stream_ids] = stream_id; | |
295 num_stream_ids++; | |
296 | |
297 } else { | |
298 printf ("unknown object\n"); | |
299 } | |
300 | |
301 // printf ("length : %lld\n", length); | |
302 | |
303 i += length-24; | |
304 | |
305 } | |
306 | |
307 return packet_length; | |
308 | |
309 } | |
310 | |
311 | |
7880 | 312 static int get_media_packet (int s, int padding, streaming_ctrl_t *stream_ctrl) { |
6092 | 313 unsigned char pre_header[8]; |
314 char data[BUF_SIZE]; | |
7880 | 315 |
316 if (!get_data (s, pre_header, 8)) { | |
317 printf ("pre-header read failed\n"); | |
318 return 0; | |
319 } | |
320 | |
321 // for (i=0; i<8; i++) | |
322 // printf ("pre_header[%d] = %02x (%d)\n", | |
323 // i, pre_header[i], pre_header[i]); | |
324 | |
325 if (pre_header[4] == 0x04) { | |
326 | |
327 int packet_len; | |
328 | |
329 packet_len = (pre_header[7] << 8 | pre_header[6]) - 8; | |
330 | |
331 // printf ("asf media packet detected, len=%d\n", packet_len); | |
332 | |
333 if (!get_data (s, data, packet_len)) { | |
334 printf ("media data read failed\n"); | |
335 return 0; | |
336 } | |
337 | |
338 streaming_bufferize(stream_ctrl, data, padding); | |
339 | |
340 } else { | |
341 | |
7953 | 342 int32_t packet_len; |
343 int command; | |
7880 | 344 |
7953 | 345 if (!get_data (s, (char*)&packet_len, 4)) { |
7880 | 346 printf ("packet_len read failed\n"); |
347 return 0; | |
348 } | |
349 | |
7953 | 350 packet_len = get_32 ((unsigned char*)&packet_len, 0) + 4; |
7880 | 351 |
352 if (!get_data (s, data, packet_len)) { | |
353 printf ("command data read failed\n"); | |
354 return 0; | |
355 } | |
356 | |
357 if ( (pre_header[7] != 0xb0) || (pre_header[6] != 0x0b) | |
358 || (pre_header[5] != 0xfa) || (pre_header[4] != 0xce) ) { | |
359 | |
360 printf ("missing signature\n"); | |
361 return -1; | |
362 } | |
363 | |
364 command = get_32 (data, 24) & 0xFFFF; | |
365 | |
7977 | 366 // printf ("\ncommand packet detected, len=%d cmd=0x%X\n", packet_len, command); |
7880 | 367 |
368 if (command == 0x1b) | |
369 send_command (s, 0x1b, 0, 0, 0, data); | |
370 else if (command == 0x1e) { | |
371 printf ("everything done. Thank you for downloading a media file containing proprietary and patentend technology.\n"); | |
372 return 0; | |
373 } | |
374 else if (command == 0x21 ) { | |
375 // Looks like it's new in WMS9 | |
376 // Unknown command, but ignoring it seems to work. | |
377 return 0; | |
378 } | |
379 else if (command != 0x05) { | |
380 printf ("unknown command %02x\n", command); | |
381 return -1; | |
382 } | |
383 } | |
384 | |
385 // printf ("get media packet succ\n"); | |
386 | |
387 return 1; | |
388 } | |
6092 | 389 |
390 | |
7880 | 391 static int packet_length1; |
6092 | 392 |
393 int | |
394 asf_mmst_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *stream_ctrl ) | |
395 { | |
7880 | 396 int len; |
397 | |
398 while( stream_ctrl->buffer_size==0 ) { | |
399 // buffer is empty - fill it! | |
400 int ret = get_media_packet( fd, packet_length1, stream_ctrl); | |
401 if( ret<0 ) { | |
402 printf("get_media_packet error : %s\n",strerror(errno)); | |
403 return -1; | |
404 } | |
405 } | |
406 | |
407 len = stream_ctrl->buffer_size-stream_ctrl->buffer_pos; | |
408 if(len>size) len=size; | |
6092 | 409 memcpy( buffer, (stream_ctrl->buffer)+(stream_ctrl->buffer_pos), len ); |
410 stream_ctrl->buffer_pos += len; | |
411 if( stream_ctrl->buffer_pos>=stream_ctrl->buffer_size ) { | |
412 free( stream_ctrl->buffer ); | |
413 stream_ctrl->buffer = NULL; | |
414 stream_ctrl->buffer_size = 0; | |
415 stream_ctrl->buffer_pos = 0; | |
416 } | |
7880 | 417 return len; |
6092 | 418 |
419 } | |
420 | |
421 int | |
422 asf_mmst_streaming_seek( int fd, off_t pos, streaming_ctrl_t *streaming_ctrl ) | |
423 { | |
424 return -1; | |
7953 | 425 // Shut up gcc warning |
426 fd++; | |
427 pos++; | |
428 streaming_ctrl=NULL; | |
6092 | 429 } |
430 | |
431 int asf_mmst_streaming_start(stream_t *stream) | |
432 { | |
433 char str[1024]; | |
10183 | 434 char data[BUF_SIZE]; |
6092 | 435 uint8_t asf_header[8192]; |
436 int asf_header_len; | |
437 int len, i, packet_length; | |
438 char *path; | |
439 URL_t *url1 = stream->streaming_ctrl->url; | |
7953 | 440 int s = stream->fd; |
6092 | 441 |
7250
27a1315d6af4
Checked if the connection succeeded before writing in the socket.
bertrand
parents:
6092
diff
changeset
|
442 if( s>0 ) { |
10281 | 443 closesocket( stream->fd ); |
7250
27a1315d6af4
Checked if the connection succeeded before writing in the socket.
bertrand
parents:
6092
diff
changeset
|
444 stream->fd = -1; |
27a1315d6af4
Checked if the connection succeeded before writing in the socket.
bertrand
parents:
6092
diff
changeset
|
445 } |
27a1315d6af4
Checked if the connection succeeded before writing in the socket.
bertrand
parents:
6092
diff
changeset
|
446 |
6092 | 447 /* parse url */ |
448 path = strchr(url1->file,'/') + 1; | |
449 | |
450 url1->port=1755; | |
10625
620cc649f519
ftp support. The change on connect2Server is needed bcs we need 2
albeu
parents:
10281
diff
changeset
|
451 s = connect2Server( url1->hostname, url1->port, 1); |
7250
27a1315d6af4
Checked if the connection succeeded before writing in the socket.
bertrand
parents:
6092
diff
changeset
|
452 if( s<0 ) { |
27a1315d6af4
Checked if the connection succeeded before writing in the socket.
bertrand
parents:
6092
diff
changeset
|
453 return s; |
27a1315d6af4
Checked if the connection succeeded before writing in the socket.
bertrand
parents:
6092
diff
changeset
|
454 } |
6092 | 455 printf ("connected\n"); |
7880 | 456 |
457 seq_num=0; | |
6092 | 458 |
459 /* | |
460 * Send the initial connect info including player version no. Client GUID (random) and the host address being connected to. | |
461 * This command is sent at the very start of protocol initiation. It sends local information to the serve | |
462 * cmd 1 0x01 | |
463 * */ | |
464 | |
10183 | 465 snprintf (str, 1023, "\034\003NSPlayer/7.0.0.1956; {33715801-BAB3-9D85-24E9-03B90328270A}; Host: %s", url1->hostname); |
11225
48bb1fd37d2a
Fixing tons of 10ls. Patch by rgselk <rgselknospam@yahoo.com>
alex
parents:
10625
diff
changeset
|
466 string_utf16 (data, str, strlen(str)); |
6092 | 467 // send_command(s, commandno ....) |
11225
48bb1fd37d2a
Fixing tons of 10ls. Patch by rgselk <rgselknospam@yahoo.com>
alex
parents:
10625
diff
changeset
|
468 send_command (s, 1, 0, 0x0004000b, strlen(str)*2+2, data); |
6092 | 469 |
10206
35e306346e59
Using recv/send instead read/write for proper MinGW support (it's a 4.2BSD standard). Patch by FloDt <flodt8@yahoo.de>
alex
parents:
10183
diff
changeset
|
470 len = recv (s, data, BUF_SIZE, 0) ; |
6092 | 471 |
472 /*This sends details of the local machine IP address to a Funnel system at the server. | |
473 * Also, the TCP or UDP transport selection is sent. | |
474 * | |
11225
48bb1fd37d2a
Fixing tons of 10ls. Patch by rgselk <rgselknospam@yahoo.com>
alex
parents:
10625
diff
changeset
|
475 * here 192.168.0.1 is local ip address TCP/UDP states the tronsport we r using |
6092 | 476 * and 1037 is the local TCP or UDP socket number |
477 * cmd 2 0x02 | |
478 * */ | |
479 | |
11225
48bb1fd37d2a
Fixing tons of 10ls. Patch by rgselk <rgselknospam@yahoo.com>
alex
parents:
10625
diff
changeset
|
480 string_utf16 (&data[8], "\002\000\\\\192.168.0.1\\TCP\\1037", 24); |
6092 | 481 memset (data, 0, 8); |
11225
48bb1fd37d2a
Fixing tons of 10ls. Patch by rgselk <rgselknospam@yahoo.com>
alex
parents:
10625
diff
changeset
|
482 send_command (s, 2, 0, 0, 24*2+10, data); |
6092 | 483 |
10206
35e306346e59
Using recv/send instead read/write for proper MinGW support (it's a 4.2BSD standard). Patch by FloDt <flodt8@yahoo.de>
alex
parents:
10183
diff
changeset
|
484 len = recv (s, data, BUF_SIZE, 0) ; |
6092 | 485 |
486 /* This command sends file path (at server) and file name request to the server. | |
487 * 0x5 */ | |
488 | |
489 string_utf16 (&data[8], path, strlen(path)); | |
490 memset (data, 0, 8); | |
11225
48bb1fd37d2a
Fixing tons of 10ls. Patch by rgselk <rgselknospam@yahoo.com>
alex
parents:
10625
diff
changeset
|
491 send_command (s, 5, 0, 0, strlen(path)*2+10, data); |
6092 | 492 |
493 get_answer (s); | |
494 | |
495 /* The ASF header chunk request. Includes ?session' variable for pre header value. | |
496 * After this command is sent, | |
497 * the server replies with 0x11 command and then the header chunk with header data follows. | |
498 * 0x15 */ | |
499 | |
500 memset (data, 0, 40); | |
501 data[32] = 2; | |
502 | |
503 send_command (s, 0x15, 1, 0, 40, data); | |
504 | |
505 num_stream_ids = 0; | |
506 /* get_headers(s, asf_header); */ | |
507 | |
508 asf_header_len = get_header (s, asf_header, stream->streaming_ctrl); | |
509 // printf("---------------------------------- asf_header %d\n",asf_header); | |
510 packet_length = interp_header (asf_header, asf_header_len); | |
511 | |
512 | |
513 /* | |
514 * This command is the media stream MBR selector. Switches are always 6 bytes in length. | |
515 * After all switch elements, data ends with bytes [00 00] 00 20 ac 40 [02]. | |
516 * Where: | |
517 * [00 00] shows 0x61 0x00 (on the first 33 sent) or 0xff 0xff for ASF files, and with no ending data for WMV files. | |
518 * It is not yet understood what all this means. | |
519 * And the last [02] byte is probably the header ?session' value. | |
520 * | |
521 * 0x33 */ | |
522 | |
523 memset (data, 0, 40); | |
524 | |
525 for (i=1; i<num_stream_ids; i++) { | |
526 data [ (i-1) * 6 + 2 ] = 0xFF; | |
527 data [ (i-1) * 6 + 3 ] = 0xFF; | |
528 data [ (i-1) * 6 + 4 ] = stream_ids[i]; | |
529 data [ (i-1) * 6 + 5 ] = 0x00; | |
530 } | |
531 | |
532 send_command (s, 0x33, num_stream_ids, 0xFFFF | stream_ids[0] << 16, (num_stream_ids-1)*6+2 , data); | |
533 | |
534 get_answer (s); | |
535 | |
536 /* Start sending file from packet xx. | |
537 * This command is also used for resume downloads or requesting a lost packet. | |
538 * Also used for seeking by sending a play point value which seeks to the media time point. | |
539 * Includes ?session' value in pre header and the maximum media stream time. | |
540 * 0x07 */ | |
541 | |
542 memset (data, 0, 40); | |
543 | |
544 for (i=8; i<16; i++) | |
545 data[i] = 0xFF; | |
546 | |
547 data[20] = 0x04; | |
548 | |
549 send_command (s, 0x07, 1, 0xFFFF | stream_ids[0] << 16, 24, data); | |
550 | |
7880 | 551 stream->fd = s; |
552 stream->streaming_ctrl->streaming_read = asf_mmst_streaming_read; | |
553 stream->streaming_ctrl->streaming_seek = asf_mmst_streaming_seek; | |
554 stream->streaming_ctrl->buffering = 1; | |
555 stream->streaming_ctrl->status = streaming_playing_e; | |
6092 | 556 |
7880 | 557 packet_length1 = packet_length; |
558 printf("mmst packet_length = %d\n",packet_length); | |
6092 | 559 |
560 return 0; | |
561 } |