aboutsummaryrefslogtreecommitdiff
path: root/libavformat/rdt.c
diff options
context:
space:
mode:
authorMichael Niedermayer2014-10-24 00:23:52 +0200
committerMichael Niedermayer2014-10-25 21:17:27 +0200
commit13ee94a480e8812593d47954d960c7bb97bd87b1 (patch)
tree110670060f70739763d1c5ff2955f770c707e8e0 /libavformat/rdt.c
parent5f558198502001c7f26601352b979738e2e16b42 (diff)
avformat/rdt: Forward whitelists to rdt demuxer
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rdt.c')
-rw-r--r--libavformat/rdt.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index e8dc8f5892..158a8212e1 100644
--- a/libavformat/rdt.c
+++ b/libavformat/rdt.c
@@ -523,18 +523,27 @@ static PayloadContext *
rdt_new_context (void)
{
PayloadContext *rdt = av_mallocz(sizeof(PayloadContext));
- int ret;
if (!rdt)
return NULL;
- ret = avformat_open_input(&rdt->rmctx, "", &ff_rdt_demuxer, NULL);
- if (ret < 0) {
- av_free(rdt);
- return NULL;
- }
+
+ rdt->rmctx = avformat_alloc_context();
+ if (!rdt->rmctx)
+ av_freep(&rdt);
return rdt;
}
+static int
+rdt_init_context (AVFormatContext *s, int st_index, PayloadContext *rdt)
+{
+ int ret;
+
+ if ((ret = ff_copy_whitelists(rdt->rmctx, s)) < 0)
+ return ret;
+
+ return avformat_open_input(&rdt->rmctx, "", &ff_rdt_demuxer, NULL);
+}
+
static void
rdt_free_context (PayloadContext *rdt)
{
@@ -559,6 +568,7 @@ static RTPDynamicProtocolHandler rdt_ ## n ## _handler = { \
.codec_id = AV_CODEC_ID_NONE, \
.parse_sdp_a_line = rdt_parse_sdp_line, \
.alloc = rdt_new_context, \
+ .init = rdt_init_context, \
.free = rdt_free_context, \
.parse_packet = rdt_parse_packet \
}