aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/udp.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-04-15 16:42:09 +0200
committerAnton Khirnov <anton@khirnov.net>2011-04-19 19:47:58 +0200
commit59d96941f0285a501989d5f2c9b69be0a1393ed5 (patch)
tree8a8df3842d20ac6543309dc4063376bf50580944 /libavformat/udp.c
parent490a022d86ef1c506a79744c5a95368af356fc69 (diff)
downloadffmpeg-59d96941f0285a501989d5f2c9b69be0a1393ed5.tar.gz
avio: remove AVIO_* access symbols in favor of new AVIO_FLAG_* symbols
Make AVIO_FLAG_ access constants work as flags, and in particular fix the behavior of functions (such as avio_check()) which expect them to be flags rather than modes. This breaks API.
Diffstat (limited to 'libavformat/udp.c')
-rw-r--r--libavformat/udp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/udp.c b/libavformat/udp.c
index e16dc4c7e0..76e3f1a4a2 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -315,7 +315,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
h->is_streamed = 1;
h->max_packet_size = 1472;
- is_output = (flags & AVIO_WRONLY);
+ is_output = (flags & AVIO_FLAG_WRITE);
s = av_mallocz(sizeof(UDPContext));
if (!s)
@@ -358,14 +358,14 @@ static int udp_open(URLContext *h, const char *uri, int flags)
/* XXX: fix av_url_split */
if (hostname[0] == '\0' || hostname[0] == '?') {
/* only accepts null hostname if input */
- if (flags & AVIO_WRONLY)
+ if (flags & AVIO_FLAG_WRITE)
goto fail;
} else {
if (ff_udp_set_remote_url(h, uri) < 0)
goto fail;
}
- if (s->is_multicast && !(h->flags & AVIO_WRONLY))
+ if (s->is_multicast && !(h->flags & AVIO_FLAG_WRITE))
s->local_port = port;
udp_fd = udp_socket_create(s, &my_addr, &len);
if (udp_fd < 0)
@@ -382,7 +382,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
/* the bind is needed to give a port to the socket now */
/* if multicast, try the multicast address bind first */
- if (s->is_multicast && !(h->flags & AVIO_WRONLY)) {
+ if (s->is_multicast && !(h->flags & AVIO_FLAG_WRITE)) {
bind_ret = bind(udp_fd,(struct sockaddr *)&s->dest_addr, len);
}
/* bind to the local address if not multicast or if the multicast
@@ -395,7 +395,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
s->local_port = udp_port(&my_addr, len);
if (s->is_multicast) {
- if (h->flags & AVIO_WRONLY) {
+ if (h->flags & AVIO_FLAG_WRITE) {
/* output */
if (udp_set_multicast_ttl(udp_fd, s->ttl, (struct sockaddr *)&s->dest_addr) < 0)
goto fail;
@@ -478,7 +478,7 @@ static int udp_close(URLContext *h)
{
UDPContext *s = h->priv_data;
- if (s->is_multicast && !(h->flags & AVIO_WRONLY))
+ if (s->is_multicast && !(h->flags & AVIO_FLAG_WRITE))
udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr);
closesocket(s->udp_fd);
av_free(s);