Mercurial > mplayer.hg
annotate stream/stream_netstream.h @ 30335:a31ec2f03d54
Make selfTest() perform tests where both the input and output formats
are supported, avoid pointless loops.
author | stefano |
---|---|
date | Tue, 19 Jan 2010 21:52:00 +0000 |
parents | b4cbeff5153e |
children | ce0122361a39 |
rev | line source |
---|---|
27745
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
1 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
2 /* |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
3 * Common stuff for netstream |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
4 * Packets and so on are defined here along with a few helpers |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
5 * wich are used by both the client and the server |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
6 * |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
7 * Data is always low endian |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
8 */ |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
9 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
10 #ifndef MPLAYER_NETSTREAM_H |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
11 #define MPLAYER_NETSTREAM_H |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
12 |
30165 | 13 #include "config.h" |
27745
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
14 #include <stdint.h> |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
15 #include <stdlib.h> |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
16 #include <string.h> |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
17 #include <errno.h> |
28402 | 18 #if !HAVE_WINSOCK2_H |
27745
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
19 #include <sys/socket.h> |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
20 #endif |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
21 #include "mp_msg.h" |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
22 #include "mpbswap.h" |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
23 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
24 typedef struct mp_net_stream_packet_st { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
25 uint16_t len; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
26 uint8_t cmd; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
27 char data[0]; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
28 } __attribute__ ((packed)) mp_net_stream_packet_t; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
29 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
30 #define PACKET_MAX_SIZE 4096 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
31 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
32 // Commands sent by the client |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
33 #define NET_STREAM_OPEN 0 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
34 // data is the url |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
35 #define NET_STREAM_FILL_BUFFER 1 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
36 // data is an uint16 wich is the max len of the data to return |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
37 #define NET_STREAM_SEEK 3 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
38 // data is an uint64 wich the pos where to seek |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
39 #define NET_STREAM_CLOSE 4 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
40 // no data |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
41 #define NET_STREAM_RESET 5 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
42 // no data |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
43 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
44 // Server response |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
45 #define NET_STREAM_OK 128 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
46 // Data returned if open is successful |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
47 typedef struct mp_net_stream_opened_st { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
48 uint32_t file_format; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
49 uint32_t flags; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
50 uint32_t sector_size; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
51 uint64_t start_pos; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
52 uint64_t end_pos; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
53 } __attribute__ ((packed)) mp_net_stream_opened_t; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
54 // FILL_BUFFER return the data |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
55 // CLOSE return nothing |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
56 #define NET_STREAM_ERROR 129 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
57 // Data is the error message (if any ;) |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
58 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
59 static int net_read(int fd, char* buf, int len) { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
60 int r = 0; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
61 while(len) { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
62 r = recv(fd,buf,len,0); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
63 if(r <= 0) { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
64 if(errno == EINTR) continue; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
65 if(r < 0) |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
66 mp_msg(MSGT_NETST,MSGL_ERR,"Read failed: %s\n",strerror(errno)); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
67 return 0; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
68 } |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
69 len -= r; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
70 buf += r; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
71 } |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
72 return 1; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
73 } |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
74 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
75 static mp_net_stream_packet_t* read_packet(int fd) { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
76 uint16_t len; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28402
diff
changeset
|
77 mp_net_stream_packet_t* pack = |
27745
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
78 (mp_net_stream_packet_t*)malloc(sizeof(mp_net_stream_packet_t)); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28402
diff
changeset
|
79 |
27745
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
80 if(!net_read(fd,(char*)pack,sizeof(mp_net_stream_packet_t))) { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
81 free(pack); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
82 return NULL; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
83 } |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
84 pack->len = le2me_16(pack->len); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
85 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
86 if(pack->len < sizeof(mp_net_stream_packet_t)) { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
87 mp_msg(MSGT_NETST,MSGL_WARN,"Got invalid packet (too small: %d)\n",pack->len); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
88 free(pack); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
89 return NULL; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
90 } |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
91 if(pack->len > PACKET_MAX_SIZE) { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
92 mp_msg(MSGT_NETST,MSGL_WARN,"Got invalid packet (too big: %d)\n",pack->len); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
93 free(pack); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
94 return NULL; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
95 } |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
96 len = pack->len; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
97 if(len > sizeof(mp_net_stream_packet_t)) { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
98 pack = realloc(pack,len); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
99 if(!pack) { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
100 mp_msg(MSGT_NETST,MSGL_ERR,"Failed to get memory for the packet (%d bytes)\n",len); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
101 return NULL; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
102 } |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
103 if(!net_read(fd,pack->data,len - sizeof(mp_net_stream_packet_t))) |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
104 return NULL; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
105 } |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
106 // printf ("Read packet %d %d %d\n",fd,pack->cmd,pack->len); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
107 return pack; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
108 } |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
109 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
110 static int net_write(int fd, char* buf, int len) { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
111 int w; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
112 while(len) { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
113 w = send(fd,buf,len,0); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
114 if(w <= 0) { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
115 if(errno == EINTR) continue; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
116 if(w < 0) |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
117 mp_msg(MSGT_NETST,MSGL_ERR,"Write failed: %s\n",strerror(errno)); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
118 return 0; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
119 } |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
120 len -= w; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
121 buf += w; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
122 } |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
123 return 1; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
124 } |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
125 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
126 static int write_packet(int fd, uint8_t cmd,char* data,int len) { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
127 mp_net_stream_packet_t* pack = malloc(len + sizeof(mp_net_stream_packet_t)); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28402
diff
changeset
|
128 |
27745
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
129 if(len > 0 && data) |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
130 memcpy(pack->data,data,len); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
131 pack->len = len + sizeof(mp_net_stream_packet_t); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
132 pack->cmd = cmd; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28402
diff
changeset
|
133 |
27745
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
134 // printf("Write packet %d %d (%p) %d\n",fd,cmd,data,len); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
135 pack->len = le2me_16(pack->len); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
136 if(net_write(fd,(char*)pack,pack->len)) { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
137 free(pack); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
138 return 1; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
139 } |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
140 free(pack); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
141 return 0; |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
142 } |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
143 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
144 static void net_stream_opened_2_me(mp_net_stream_opened_t* o) { |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
145 o->file_format = le2me_32(o->file_format); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
146 o->flags = le2me_32(o->flags); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
147 o->sector_size = le2me_32(o->sector_size); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
148 o->start_pos = le2me_64(o->start_pos); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
149 o->end_pos = le2me_64(o->end_pos); |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
150 } |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
151 |
a5ed200519dc
Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff
changeset
|
152 #endif /* MPLAYER_NETSTREAM_H */ |