aboutsummaryrefslogtreecommitdiff
path: root/libavformat/sapenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer2011-04-05 02:24:55 +0200
committerMichael Niedermayer2011-04-05 02:31:56 +0200
commit434f248723d4d3e22545c3542ef9fc7c00b2379b (patch)
tree4c399c1fa89215676e14f57c84a3244af806c39e /libavformat/sapenc.c
parent6114bffa91714c83a533ae7e5a597ee605d35c3d (diff)
parent2310ee4b1cca48609d06774b7c3c70a5f38f3473 (diff)
Merge remote branch 'qatar/master'
* qatar/master: (22 commits) ac3enc: move extract_exponents inner loop to ac3dsp avio: deprecate url_get_filename(). avio: deprecate url_max_packet_size(). avio: make url_get_file_handle() internal. avio: make url_filesize() internal. avio: make url_close() internal. avio: make url_seek() internal. avio: cosmetics, move AVSEEK_SIZE/FORCE declarations together avio: make url_write() internal. avio: make url_read_complete() internal. avio: make url_read() internal. avio: make url_open() internal. avio: make url_connect internal. avio: make url_alloc internal. applehttp: Merge two for loops applehttp: Restructure the demuxer to use a custom AVIOContext applehttp: Move finished and target_duration to the variant struct aacenc: reduce the number of loop index variables avio: deprecate url_open_protocol avio: deprecate url_poll and URLPollEntry ... Conflicts: libavformat/applehttp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/sapenc.c')
-rw-r--r--libavformat/sapenc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/libavformat/sapenc.c b/libavformat/sapenc.c
index bc66adcd77..0569d790ce 100644
--- a/libavformat/sapenc.c
+++ b/libavformat/sapenc.c
@@ -28,6 +28,7 @@
#include "network.h"
#include "os_support.h"
#include "rtpenc_chain.h"
+#include "url.h"
struct SAPState {
uint8_t *ann;
@@ -53,12 +54,12 @@ static int sap_write_close(AVFormatContext *s)
if (sap->last_time && sap->ann && sap->ann_fd) {
sap->ann[0] |= 4; /* Session deletion*/
- url_write(sap->ann_fd, sap->ann, sap->ann_size);
+ ffurl_write(sap->ann_fd, sap->ann, sap->ann_size);
}
av_freep(&sap->ann);
if (sap->ann_fd)
- url_close(sap->ann_fd);
+ ffurl_close(sap->ann_fd);
ff_network_close();
return 0;
}
@@ -145,7 +146,7 @@ static int sap_write_header(AVFormatContext *s)
"?ttl=%d", ttl);
if (!same_port)
base_port += 2;
- ret = url_open(&fd, url, URL_WRONLY);
+ ret = ffurl_open(&fd, url, URL_WRONLY);
if (ret) {
ret = AVERROR(EIO);
goto fail;
@@ -157,13 +158,13 @@ static int sap_write_header(AVFormatContext *s)
ff_url_join(url, sizeof(url), "udp", NULL, announce_addr, port,
"?ttl=%d&connect=1", ttl);
- ret = url_open(&sap->ann_fd, url, URL_WRONLY);
+ ret = ffurl_open(&sap->ann_fd, url, URL_WRONLY);
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;
@@ -217,7 +218,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;
@@ -238,7 +239,7 @@ static int sap_write_packet(AVFormatContext *s, AVPacket *pkt)
int64_t now = av_gettime();
if (!sap->last_time || now - sap->last_time > 5000000) {
- int ret = url_write(sap->ann_fd, sap->ann, sap->ann_size);
+ int ret = ffurl_write(sap->ann_fd, sap->ann, sap->ann_size);
/* Don't abort even if we get "Destination unreachable" */
if (ret < 0 && ret != AVERROR(ECONNREFUSED))
return ret;