annotate stream/stream_netstream.h @ 36722:af6374499845

Don't unnecessarily stop Win32 GUI playback. There is no reason to do so in the preferences dialog.
author ib
date Sun, 09 Feb 2014 17:52:18 +0000
parents f8f6da5f5c57
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 * Common stuff for netstream
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
3 * 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
4 * 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
5 *
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
6 * Data is always low endian
30426
ce0122361a39 Add license header to all files missing it in the stream subdirectory.
diego
parents: 30165
diff changeset
7 *
ce0122361a39 Add license header to all files missing it in the stream subdirectory.
diego
parents: 30165
diff changeset
8 * This file is part of MPlayer.
ce0122361a39 Add license header to all files missing it in the stream subdirectory.
diego
parents: 30165
diff changeset
9 *
ce0122361a39 Add license header to all files missing it in the stream subdirectory.
diego
parents: 30165
diff changeset
10 * MPlayer is free software; you can redistribute it and/or modify
ce0122361a39 Add license header to all files missing it in the stream subdirectory.
diego
parents: 30165
diff changeset
11 * it under the terms of the GNU General Public License as published by
ce0122361a39 Add license header to all files missing it in the stream subdirectory.
diego
parents: 30165
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
ce0122361a39 Add license header to all files missing it in the stream subdirectory.
diego
parents: 30165
diff changeset
13 * (at your option) any later version.
ce0122361a39 Add license header to all files missing it in the stream subdirectory.
diego
parents: 30165
diff changeset
14 *
ce0122361a39 Add license header to all files missing it in the stream subdirectory.
diego
parents: 30165
diff changeset
15 * MPlayer is distributed in the hope that it will be useful,
ce0122361a39 Add license header to all files missing it in the stream subdirectory.
diego
parents: 30165
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ce0122361a39 Add license header to all files missing it in the stream subdirectory.
diego
parents: 30165
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ce0122361a39 Add license header to all files missing it in the stream subdirectory.
diego
parents: 30165
diff changeset
18 * GNU General Public License for more details.
ce0122361a39 Add license header to all files missing it in the stream subdirectory.
diego
parents: 30165
diff changeset
19 *
ce0122361a39 Add license header to all files missing it in the stream subdirectory.
diego
parents: 30165
diff changeset
20 * You should have received a copy of the GNU General Public License along
ce0122361a39 Add license header to all files missing it in the stream subdirectory.
diego
parents: 30165
diff changeset
21 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
ce0122361a39 Add license header to all files missing it in the stream subdirectory.
diego
parents: 30165
diff changeset
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27745
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
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
25 #ifndef MPLAYER_NETSTREAM_H
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
26 #define MPLAYER_NETSTREAM_H
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
27
30165
b4cbeff5153e Add a few missing header #includes and #defines.
diego
parents: 29263
diff changeset
28 #include "config.h"
27745
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
29 #include <stdint.h>
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
30 #include <stdlib.h>
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
31 #include <string.h>
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
32 #include <errno.h>
28402
c884d17bd005 Convert HAVE_WINSOCK2_H into a 0/1 definition.
diego
parents: 27745
diff changeset
33 #if !HAVE_WINSOCK2_H
27745
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
34 #include <sys/socket.h>
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
35 #endif
31892
b2329beb7406 Add #includes for headers necessary to pass 'make checkheaders'.
diego
parents: 31500
diff changeset
36
27745
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
37 #include "mp_msg.h"
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
38 #include "mpbswap.h"
31892
b2329beb7406 Add #includes for headers necessary to pass 'make checkheaders'.
diego
parents: 31500
diff changeset
39 #include "network.h"
27745
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
40
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
41 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
42 uint16_t len;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
43 uint8_t cmd;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
44 char data[0];
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
45 } __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
46
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
47 #define PACKET_MAX_SIZE 4096
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
48
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
49 // Commands sent by the client
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
50 #define NET_STREAM_OPEN 0
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
51 // data is the url
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
52 #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
53 // 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
54 #define NET_STREAM_SEEK 3
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
55 // 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
56 #define NET_STREAM_CLOSE 4
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
57 // no data
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
58 #define NET_STREAM_RESET 5
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
59 // no data
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
60
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
61 // Server response
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
62 #define NET_STREAM_OK 128
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
63 // 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
64 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
65 uint32_t file_format;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
66 uint32_t flags;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
67 uint32_t sector_size;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
68 uint64_t start_pos;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
69 uint64_t end_pos;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
70 } __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
71 // FILL_BUFFER return the data
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
72 // CLOSE return nothing
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
73 #define NET_STREAM_ERROR 129
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
74 // 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
75
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
76 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
77 int r = 0;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
78 while(len) {
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
79 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
80 if(r <= 0) {
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
81 if(errno == EINTR) continue;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
82 if(r < 0)
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
83 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
84 return 0;
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 len -= r;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
87 buf += r;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
88 }
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
89 return 1;
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
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
92 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
93 uint16_t len;
36633
f8f6da5f5c57 stream_netstream: Simplify packet handling.
reimar
parents: 31892
diff changeset
94 mp_net_stream_packet_t* pack = calloc(1, PACKET_MAX_SIZE + 1);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28402
diff changeset
95
36633
f8f6da5f5c57 stream_netstream: Simplify packet handling.
reimar
parents: 31892
diff changeset
96 if(!pack || !net_read(fd,(char*)pack,sizeof(mp_net_stream_packet_t)))
f8f6da5f5c57 stream_netstream: Simplify packet handling.
reimar
parents: 31892
diff changeset
97 goto err_out;
27745
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
98 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
99
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
100 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
101 mp_msg(MSGT_NETST,MSGL_WARN,"Got invalid packet (too small: %d)\n",pack->len);
36633
f8f6da5f5c57 stream_netstream: Simplify packet handling.
reimar
parents: 31892
diff changeset
102 goto err_out;
27745
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
103 }
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
104 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
105 mp_msg(MSGT_NETST,MSGL_WARN,"Got invalid packet (too big: %d)\n",pack->len);
36633
f8f6da5f5c57 stream_netstream: Simplify packet handling.
reimar
parents: 31892
diff changeset
106 goto err_out;
27745
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
107 }
36633
f8f6da5f5c57 stream_netstream: Simplify packet handling.
reimar
parents: 31892
diff changeset
108 pack->len -= sizeof(mp_net_stream_packet_t);
27745
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
109 len = pack->len;
36633
f8f6da5f5c57 stream_netstream: Simplify packet handling.
reimar
parents: 31892
diff changeset
110 if(len > 0 && !net_read(fd,pack->data,len))
f8f6da5f5c57 stream_netstream: Simplify packet handling.
reimar
parents: 31892
diff changeset
111 goto err_out;
27745
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
112 // 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
113 return pack;
36633
f8f6da5f5c57 stream_netstream: Simplify packet handling.
reimar
parents: 31892
diff changeset
114
f8f6da5f5c57 stream_netstream: Simplify packet handling.
reimar
parents: 31892
diff changeset
115 err_out:
f8f6da5f5c57 stream_netstream: Simplify packet handling.
reimar
parents: 31892
diff changeset
116 free(pack);
f8f6da5f5c57 stream_netstream: Simplify packet handling.
reimar
parents: 31892
diff changeset
117 return NULL;
27745
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
118 }
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 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
121 int w;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
122 while(len) {
31500
b01f807eb183 Use MSG_NOSIGNAL flag if available for send().
reimar
parents: 30702
diff changeset
123 w = send(fd,buf,len,DEFAULT_SEND_FLAGS);
27745
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
124 if(w <= 0) {
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
125 if(errno == EINTR) continue;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
126 if(w < 0)
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
127 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
128 return 0;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
129 }
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
130 len -= w;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
131 buf += w;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
132 }
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
133 return 1;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
134 }
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
135
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
136 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
137 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
138
27745
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
139 if(len > 0 && data)
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
140 memcpy(pack->data,data,len);
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
141 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
142 pack->cmd = cmd;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 28402
diff changeset
143
27745
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
144 // 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
145 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
146 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
147 free(pack);
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
148 return 1;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
149 }
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
150 free(pack);
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
151 return 0;
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
152 }
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
153
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
154 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
155 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
156 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
157 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
158 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
159 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
160 }
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
161
a5ed200519dc Rename stream/netstream.h to stream/stream_netstream.h; netstream.h to make it
diego
parents:
diff changeset
162 #endif /* MPLAYER_NETSTREAM_H */