[FFmpeg-cvslog] udp: support old, crappy non pthread mode

Michael Niedermayer git at videolan.org
Sat Jun 4 17:04:22 CEST 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jun  4 16:55:22 2011 +0200| [124a9edb5f172ce36b11fd0d6ccc9f15cc51f322] | committer: Michael Niedermayer

udp: support old, crappy non pthread mode

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=124a9edb5f172ce36b11fd0d6ccc9f15cc51f322
---

 configure         |    2 +-
 libavformat/udp.c |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index c054f81..a1110bd 100755
--- a/configure
+++ b/configure
@@ -1493,7 +1493,7 @@ mmst_protocol_deps="network"
 rtmp_protocol_select="tcp_protocol"
 rtp_protocol_select="udp_protocol"
 tcp_protocol_deps="network"
-udp_protocol_deps="network pthreads"
+udp_protocol_deps="network"
 
 # filters
 blackframe_filter_deps="gpl"
diff --git a/libavformat/udp.c b/libavformat/udp.c
index 7a01d29..7c18fb7 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -35,7 +35,11 @@
 #include "network.h"
 #include "os_support.h"
 #include "url.h"
+
+#if HAVE_PTHREADS
 #include <pthread.h>
+#endif
+
 #include <sys/time.h>
 
 #ifndef IPV6_ADD_MEMBERSHIP
@@ -58,7 +62,9 @@ typedef struct {
     int circular_buffer_size;
     AVFifoBuffer *fifo;
     int circular_buffer_error;
+#if HAVE_PTHREADS
     pthread_t circular_buffer_thread;
+#endif
 } UDPContext;
 
 #define UDP_TX_BUF_SIZE 32768
@@ -505,6 +511,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
 
     s->udp_fd = udp_fd;
 
+#if HAVE_PTHREADS
     if (!is_output && s->circular_buffer_size) {
         /* start the task going */
         s->fifo = av_fifo_alloc(s->circular_buffer_size);
@@ -513,6 +520,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
             goto fail;
         }
     }
+#endif
 
     return 0;
  fail:



More information about the ffmpeg-cvslog mailing list