[FFmpeg-devel] [PATCH] Support RTSP when pthreads is not available.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Jun 3 21:45:12 CEST 2011


Only disable RTSP-over-UDP, which is the only part
that actually requires pthreads.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
 configure          |    2 +-
 libavformat/rtsp.c |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index c054f81..85b9b47 100755
--- a/configure
+++ b/configure
@@ -1451,7 +1451,7 @@ mxf_d10_muxer_select="mxf_muxer"
 ogg_demuxer_select="golomb"
 psp_muxer_select="mov_muxer"
 rtp_demuxer_select="sdp_demuxer"
-rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer"
+rtpdec_select="asf_demuxer rm_demuxer mpegts_demuxer mov_demuxer"
 rtsp_demuxer_select="http_protocol rtpdec"
 rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol"
 sap_demuxer_select="sdp_demuxer"
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 3efa056..385a599 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1102,7 +1102,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
             rtsp_st = rt->rtsp_streams[i];
 
         /* RTP/UDP */
-        if (lower_transport == RTSP_LOWER_TRANSPORT_UDP) {
+        if (CONFIG_RTP_PROTOCOL && lower_transport == RTSP_LOWER_TRANSPORT_UDP) {
             char buf[256];
 
             if (rt->server_type == RTSP_SERVER_WMS && i > 1) {
@@ -1224,6 +1224,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
             rtsp_st->interleaved_max = reply->transports[0].interleaved_max;
             break;
 
+#if CONFIG_RTP_PROTOCOL
         case RTSP_LOWER_TRANSPORT_UDP: {
             char url[1024], options[30] = "";
 
@@ -1276,6 +1277,10 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
             }
             break;
         }
+#endif
+        default:
+            err = AVERROR(ENOSYS);
+            goto fail;
         }
 
         if ((err = rtsp_open_transport_ctx(s, rtsp_st)))
@@ -1578,6 +1583,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
         } else {
             tcp_fd = -1;
         }
+#if CONFIG_RTP_PROTOCOL
         for (i = 0; i < rt->nb_rtsp_streams; i++) {
             rtsp_st = rt->rtsp_streams[i];
             if (rtsp_st->rtp_handle) {
@@ -1587,6 +1593,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
                 p[max_p++].events = POLLIN;
             }
         }
+#endif
         n = poll(p, max_p, POLL_TIMEOUT_MS);
         if (n > 0) {
             int j = 1 - (tcp_fd == -1);
-- 
1.7.5.1



More information about the ffmpeg-devel mailing list