Revision c60112f2 libavformat/udp.c

View differences:

libavformat/udp.c
266 266
                if (connect(s->udp_fd, (struct sockaddr *) &s->dest_addr,
267 267
                            s->dest_addr_len)) {
268 268
                    s->is_connected = 0;
269
                    av_log(NULL, AV_LOG_ERROR, "connect: %s\n", strerror(errno));
269
                    av_log(h, AV_LOG_ERROR, "connect: %s\n", strerror(errno));
270 270
                    return AVERROR(EIO);
271 271
                }
272 272
            }
......
410 410
        /* limit the tx buf size to limit latency */
411 411
        tmp = s->buffer_size;
412 412
        if (setsockopt(udp_fd, SOL_SOCKET, SO_SNDBUF, &tmp, sizeof(tmp)) < 0) {
413
            av_log(NULL, AV_LOG_ERROR, "setsockopt(SO_SNDBUF): %s\n", strerror(errno));
413
            av_log(h, AV_LOG_ERROR, "setsockopt(SO_SNDBUF): %s\n", strerror(errno));
414 414
            goto fail;
415 415
        }
416 416
    } else {
......
418 418
         * avoid losing data on OSes that set this too low by default. */
419 419
        tmp = s->buffer_size;
420 420
        if (setsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &tmp, sizeof(tmp)) < 0) {
421
            av_log(NULL, AV_LOG_WARNING, "setsockopt(SO_RECVBUF): %s\n", strerror(errno));
421
            av_log(h, AV_LOG_WARNING, "setsockopt(SO_RECVBUF): %s\n", strerror(errno));
422 422
        }
423 423
        /* make the socket non-blocking */
424 424
        ff_socket_nonblock(udp_fd, 1);
425 425
    }
426 426
    if (s->is_connected) {
427 427
        if (connect(udp_fd, (struct sockaddr *) &s->dest_addr, s->dest_addr_len)) {
428
            av_log(NULL, AV_LOG_ERROR, "connect: %s\n", strerror(errno));
428
            av_log(h, AV_LOG_ERROR, "connect: %s\n", strerror(errno));
429 429
            goto fail;
430 430
        }
431 431
    }

Also available in: Unified diff