X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fsapenc.c;h=d8ec465afa42445303ccbc9d99297b090989d04a;hb=53ed79a260099c761f8a74872d695a2aeb7a0ced;hp=ad8cbac52f285adf4df8e407f75375f3db260724;hpb=e52a9145c8bf0748ae970e210e528ff56508964c;p=ffmpeg diff --git a/libavformat/sapenc.c b/libavformat/sapenc.c index ad8cbac52f2..d8ec465afa4 100644 --- a/libavformat/sapenc.c +++ b/libavformat/sapenc.c @@ -146,7 +146,7 @@ static int sap_write_header(AVFormatContext *s) "?ttl=%d", ttl); if (!same_port) base_port += 2; - ret = ffurl_open(&fd, url, URL_WRONLY); + ret = ffurl_open(&fd, url, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL); if (ret) { ret = AVERROR(EIO); goto fail; @@ -158,13 +158,14 @@ static int sap_write_header(AVFormatContext *s) ff_url_join(url, sizeof(url), "udp", NULL, announce_addr, port, "?ttl=%d&connect=1", ttl); - ret = ffurl_open(&sap->ann_fd, url, URL_WRONLY); + ret = ffurl_open(&sap->ann_fd, url, AVIO_FLAG_WRITE, + &s->interrupt_callback, NULL); if (ret) { ret = AVERROR(EIO); goto fail; } - udp_fd = url_get_file_handle(sap->ann_fd); + udp_fd = ffurl_get_file_handle(sap->ann_fd); if (getsockname(udp_fd, (struct sockaddr*) &localaddr, &addrlen)) { ret = AVERROR(EIO); goto fail; @@ -208,7 +209,7 @@ static int sap_write_header(AVFormatContext *s) av_strlcpy(&sap->ann[pos], "application/sdp", sap->ann_size - pos); pos += strlen(&sap->ann[pos]) + 1; - if (avf_sdp_create(contexts, s->nb_streams, &sap->ann[pos], + if (av_sdp_create(contexts, s->nb_streams, &sap->ann[pos], sap->ann_size - pos)) { ret = AVERROR_INVALIDDATA; goto fail; @@ -218,7 +219,7 @@ static int sap_write_header(AVFormatContext *s) pos += strlen(&sap->ann[pos]); sap->ann_size = pos; - if (sap->ann_size > url_get_max_packet_size(sap->ann_fd)) { + if (sap->ann_size > sap->ann_fd->max_packet_size) { av_log(s, AV_LOG_ERROR, "Announcement too large to send in one " "packet\n"); goto fail; @@ -250,16 +251,14 @@ static int sap_write_packet(AVFormatContext *s, AVPacket *pkt) } AVOutputFormat ff_sap_muxer = { - "sap", - NULL_IF_CONFIG_SMALL("SAP output format"), - NULL, - NULL, - sizeof(struct SAPState), - CODEC_ID_AAC, - CODEC_ID_MPEG4, - sap_write_header, - sap_write_packet, - sap_write_close, + .name = "sap", + .long_name = NULL_IF_CONFIG_SMALL("SAP output format"), + .priv_data_size = sizeof(struct SAPState), + .audio_codec = CODEC_ID_AAC, + .video_codec = CODEC_ID_MPEG4, + .write_header = sap_write_header, + .write_packet = sap_write_packet, + .write_trailer = sap_write_close, .flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER, };