Revision f87b1b37 libavformat/udp.c

View differences:

libavformat/udp.c
317 317
    h->is_streamed = 1;
318 318
    h->max_packet_size = 1472;
319 319

  
320
    is_output = (flags & URL_WRONLY);
320
    is_output = (flags & AVIO_WRONLY);
321 321

  
322 322
    s = av_mallocz(sizeof(UDPContext));
323 323
    if (!s)
......
360 360
    /* XXX: fix av_url_split */
361 361
    if (hostname[0] == '\0' || hostname[0] == '?') {
362 362
        /* only accepts null hostname if input */
363
        if (flags & URL_WRONLY)
363
        if (flags & AVIO_WRONLY)
364 364
            goto fail;
365 365
    } else {
366 366
        if (ff_udp_set_remote_url(h, uri) < 0)
367 367
            goto fail;
368 368
    }
369 369

  
370
    if (s->is_multicast && !(h->flags & URL_WRONLY))
370
    if (s->is_multicast && !(h->flags & AVIO_WRONLY))
371 371
        s->local_port = port;
372 372
    udp_fd = udp_socket_create(s, &my_addr, &len);
373 373
    if (udp_fd < 0)
......
384 384

  
385 385
    /* the bind is needed to give a port to the socket now */
386 386
    /* if multicast, try the multicast address bind first */
387
    if (s->is_multicast && !(h->flags & URL_WRONLY)) {
387
    if (s->is_multicast && !(h->flags & AVIO_WRONLY)) {
388 388
        bind_ret = bind(udp_fd,(struct sockaddr *)&s->dest_addr, len);
389 389
    }
390 390
    /* bind to the local address if not multicast or if the multicast
......
397 397
    s->local_port = udp_port(&my_addr, len);
398 398

  
399 399
    if (s->is_multicast) {
400
        if (h->flags & URL_WRONLY) {
400
        if (h->flags & AVIO_WRONLY) {
401 401
            /* output */
402 402
            if (udp_set_multicast_ttl(udp_fd, s->ttl, (struct sockaddr *)&s->dest_addr) < 0)
403 403
                goto fail;
......
446 446
    UDPContext *s = h->priv_data;
447 447
    int ret;
448 448

  
449
    if (!(h->flags & URL_FLAG_NONBLOCK)) {
449
    if (!(h->flags & AVIO_FLAG_NONBLOCK)) {
450 450
        ret = ff_network_wait_fd(s->udp_fd, 0);
451 451
        if (ret < 0)
452 452
            return ret;
......
460 460
    UDPContext *s = h->priv_data;
461 461
    int ret;
462 462

  
463
    if (!(h->flags & URL_FLAG_NONBLOCK)) {
463
    if (!(h->flags & AVIO_FLAG_NONBLOCK)) {
464 464
        ret = ff_network_wait_fd(s->udp_fd, 1);
465 465
        if (ret < 0)
466 466
            return ret;
......
480 480
{
481 481
    UDPContext *s = h->priv_data;
482 482

  
483
    if (s->is_multicast && !(h->flags & URL_WRONLY))
483
    if (s->is_multicast && !(h->flags & AVIO_WRONLY))
484 484
        udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr);
485 485
    closesocket(s->udp_fd);
486 486
    av_free(s);

Also available in: Unified diff