]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/udp.c
Support streaming .au files.
[ffmpeg] / libavformat / udp.c
index 7c18fb7bf05c368b2ca782c881ca90d6021f1223..dda7ec2d1320fa6c9053260733f66d0ea66b4122 100644 (file)
@@ -404,7 +404,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
     p = strchr(uri, '?');
     if (p) {
         if (av_find_info_tag(buf, sizeof(buf), "reuse", p)) {
-            char *endptr=NULL;
+            char *endptr = NULL;
             s->reuse_socket = strtol(buf, &endptr, 10);
             /* assume if no digits were found it is a request to enable it */
             if (buf == endptr)
@@ -426,7 +426,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
         if (av_find_info_tag(buf, sizeof(buf), "connect", p)) {
             s->is_connected = strtol(buf, NULL, 10);
         }
-        if (av_find_info_tag(buf, sizeof(buf), "buf_size", p)) {
+        if (av_find_info_tag(buf, sizeof(buf), "fifo_size", p)) {
             s->circular_buffer_size = strtol(buf, NULL, 10)*188;
         }
     }
@@ -444,7 +444,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
             goto fail;
     }
 
-    if (s->is_multicast && (h->flags & AVIO_FLAG_READ))
+    if ((s->is_multicast || !s->local_port) && (h->flags & AVIO_FLAG_READ))
         s->local_port = port;
     udp_fd = udp_socket_create(s, &my_addr, &len);
     if (udp_fd < 0)