Revision 9ddd71fc libav/udp.c

View differences:

libav/udp.c
21 21
#include <sys/types.h>
22 22
#include <sys/socket.h>
23 23
#include <netinet/in.h>
24
#include <arpa/inet.h>
24
#ifndef __BEOS__
25
# include <arpa/inet.h>
26
#else
27
# include "barpainet.h"
28
#endif
25 29
#include <netdb.h>
26 30

  
27 31
typedef struct {
......
154 158
    getsockname(udp_fd, (struct sockaddr *)&my_addr1, &len);
155 159
    s->local_port = ntohs(my_addr1.sin_port);
156 160

  
161
#ifndef CONFIG_BEOS_NETSERVER
157 162
    if (s->is_multicast) {
158 163
        if (h->flags & URL_WRONLY) {
159 164
            /* output */
......
174 179
            }
175 180
        }
176 181
    }
182
#endif
177 183

  
178 184
    if (is_output) {
179 185
        /* limit the tx buf size to limit latency */
......
189 195
    return 0;
190 196
 fail:
191 197
    if (udp_fd >= 0)
198
#ifdef CONFIG_BEOS_NETSERVER
199
        closesocket(udp_fd);
200
#else
192 201
        close(udp_fd);
202
#endif
193 203
    av_free(s);
194 204
    return -EIO;
195 205
}
......
237 247
{
238 248
    UDPContext *s = h->priv_data;
239 249

  
250
#ifndef CONFIG_BEOS_NETSERVER
240 251
    if (s->is_multicast && !(h->flags & URL_WRONLY)) {
241 252
        if (setsockopt(s->udp_fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, 
242 253
                       &s->mreq, sizeof(s->mreq)) < 0) {
......
244 255
        }
245 256
    }
246 257
    close(s->udp_fd);
258
#else
259
    closesocket(s->udp_fd);
260
#endif
247 261
    av_free(s);
248 262
    return 0;
249 263
}

Also available in: Unified diff