diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-08-18 15:10:13 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-18 15:20:32 +0200 |
commit | 6c180b35c43f0738d8a3d5c08a01209b51eda569 (patch) | |
tree | b278223305ed9dc4af792f53a376a558ad9155ee /libavformat/rtsp.c | |
parent | 69fc2489c4059886fcda2de91029b43447330951 (diff) | |
parent | 7f9aaa499b8a5ce066cc17aac6ebbdf0111980b6 (diff) | |
download | ffmpeg-6c180b35c43f0738d8a3d5c08a01209b51eda569.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
mpegvideo_enc: don't use deprecated avcodec_encode_video().
cmdutils: refactor -codecs option.
avconv: make -shortest a per-output file option.
lavc: add avcodec_descriptor_get_by_name().
lavc: add const to AVCodec* function parameters.
swf(dec): replace CODEC_ID with AV_CODEC_ID
dvenc: don't use deprecated AVCODEC_MAX_AUDIO_FRAME_SIZE
rtmpdh: Do not generate the same private key every time when using libnettle
rtp: remove ff_rtp_get_rtcp_file_handle().
rtsp.c: use ffurl_get_multi_file_handle() instead of ff_rtp_get_rtcp_file_handle()
avio: add (ff)url_get_multi_file_handle() for getting more than one fd
h264: vdpau: fix crash with unsupported colorspace
amrwbdec: Decode the fr_quality bit properly
Conflicts:
Changelog
cmdutils.c
cmdutils_common_opts.h
doc/ffmpeg.texi
ffmpeg.c
ffmpeg.h
ffmpeg_opt.c
libavcodec/h264.c
libavcodec/options.c
libavcodec/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r-- | libavformat/rtsp.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index b5e6858e00..35b2724950 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1690,6 +1690,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, int n, i, ret, tcp_fd, timeout_cnt = 0; int max_p = 0; struct pollfd *p = rt->p; + int *fds = NULL, fdsnum, fdsidx; for (;;) { if (ff_check_interrupt(&s->interrupt_callback)) @@ -1707,10 +1708,21 @@ 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) { - p[max_p].fd = ffurl_get_file_handle(rtsp_st->rtp_handle); - p[max_p++].events = POLLIN; - p[max_p].fd = ff_rtp_get_rtcp_file_handle(rtsp_st->rtp_handle); - p[max_p++].events = POLLIN; + if (ret = ffurl_get_multi_file_handle(rtsp_st->rtp_handle, + &fds, &fdsnum)) { + av_log(s, AV_LOG_ERROR, "Unable to recover rtp ports\n"); + return ret; + } + if (fdsnum != 2) { + av_log(s, AV_LOG_ERROR, + "Number of fds %d not supported\n", fdsnum); + return AVERROR_INVALIDDATA; + } + for (fdsidx = 0; fdsidx < fdsnum; fdsidx++) { + p[max_p].fd = fds[fdsidx]; + p[max_p++].events = POLLIN; + } + av_free(fds); } } n = poll(p, max_p, POLL_TIMEOUT_MS); |