summaryrefslogtreecommitdiff
path: root/libavformat/rtpproto.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-18 15:10:13 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-08-18 15:20:32 +0200
commit6c180b35c43f0738d8a3d5c08a01209b51eda569 (patch)
treeb278223305ed9dc4af792f53a376a558ad9155ee /libavformat/rtpproto.c
parent69fc2489c4059886fcda2de91029b43447330951 (diff)
parent7f9aaa499b8a5ce066cc17aac6ebbdf0111980b6 (diff)
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/rtpproto.c')
-rw-r--r--libavformat/rtpproto.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c
index f140580c7e..17b0f64afb 100644
--- a/libavformat/rtpproto.c
+++ b/libavformat/rtpproto.c
@@ -316,18 +316,27 @@ static int rtp_get_file_handle(URLContext *h)
return s->rtp_fd;
}
-int ff_rtp_get_rtcp_file_handle(URLContext *h) {
+static int rtp_get_multi_file_handle(URLContext *h, int **handles,
+ int *numhandles)
+{
RTPContext *s = h->priv_data;
- return s->rtcp_fd;
+ int *hs = *handles = av_malloc(sizeof(**handles) * 2);
+ if (!hs)
+ return AVERROR(ENOMEM);
+ hs[0] = s->rtp_fd;
+ hs[1] = s->rtcp_fd;
+ *numhandles = 2;
+ return 0;
}
URLProtocol ff_rtp_protocol = {
- .name = "rtp",
- .url_open = rtp_open,
- .url_read = rtp_read,
- .url_write = rtp_write,
- .url_close = rtp_close,
- .url_get_file_handle = rtp_get_file_handle,
- .priv_data_size = sizeof(RTPContext),
- .flags = URL_PROTOCOL_FLAG_NETWORK,
+ .name = "rtp",
+ .url_open = rtp_open,
+ .url_read = rtp_read,
+ .url_write = rtp_write,
+ .url_close = rtp_close,
+ .url_get_file_handle = rtp_get_file_handle,
+ .url_get_multi_file_handle = rtp_get_multi_file_handle,
+ .priv_data_size = sizeof(RTPContext),
+ .flags = URL_PROTOCOL_FLAG_NETWORK,
};