diff options
author | Josh Allmann <joshua.allmann@gmail.com> | 2010-08-29 10:16:54 +0000 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2010-08-29 10:16:54 +0000 |
commit | a1ba71aace8cca10ba2a921caa105b17370b0d27 (patch) | |
tree | 0c2925492218d221987360da994604da5de43a9d /libavformat | |
parent | 6a1712ddb502bf148af6f865bd27e3b61dbdfbab (diff) | |
download | ffmpeg-a1ba71aace8cca10ba2a921caa105b17370b0d27.tar.gz |
rtsp: Check the RTCP file handle for new packets, too
Patch by Josh Allmann, joshua dot allmann at gmail
Originally committed as revision 24962 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/rtsp.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index c228842e2b..16997e3245 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1653,7 +1653,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, RTSPState *rt = s->priv_data; RTSPStream *rtsp_st; fd_set rfds; - int fd, fd_max, n, i, ret, tcp_fd, timeout_cnt = 0; + int fd, fd_rtcp, fd_max, n, i, ret, tcp_fd, timeout_cnt = 0; struct timeval tv; for (;;) { @@ -1670,12 +1670,12 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, for (i = 0; i < rt->nb_rtsp_streams; i++) { rtsp_st = rt->rtsp_streams[i]; if (rtsp_st->rtp_handle) { - /* currently, we cannot probe RTCP handle because of - * blocking restrictions */ fd = url_get_file_handle(rtsp_st->rtp_handle); - if (fd > fd_max) - fd_max = fd; + fd_rtcp = rtp_get_rtcp_file_handle(rtsp_st->rtp_handle); + if (FFMAX(fd, fd_rtcp) > fd_max) + fd_max = FFMAX(fd, fd_rtcp); FD_SET(fd, &rfds); + FD_SET(fd_rtcp, &rfds); } } tv.tv_sec = 0; @@ -1687,7 +1687,8 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, rtsp_st = rt->rtsp_streams[i]; if (rtsp_st->rtp_handle) { fd = url_get_file_handle(rtsp_st->rtp_handle); - if (FD_ISSET(fd, &rfds)) { + fd_rtcp = rtp_get_rtcp_file_handle(rtsp_st->rtp_handle); + if (FD_ISSET(fd_rtcp, &rfds) || FD_ISSET(fd, &rfds)) { ret = url_read(rtsp_st->rtp_handle, buf, buf_size); if (ret > 0) { *prtsp_st = rtsp_st; |