diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-01-30 02:17:51 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-02-02 04:16:50 +0100 |
commit | fe3fed0b143ef6bf2d9b65ce05d55aba4224429e (patch) | |
tree | 45ead8f324a1e5190ea4905cb574325a3d9196bd /libavformat/segment.c | |
parent | 1dba8371d93cf1c83bcd5c432d921905206a60f3 (diff) | |
download | ffmpeg-fe3fed0b143ef6bf2d9b65ce05d55aba4224429e.tar.gz |
Update demuxers and protocols for protocol whitelist support
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/segment.c')
-rw-r--r-- | libavformat/segment.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libavformat/segment.c b/libavformat/segment.c index 9da51689ae..90528f3aa8 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -30,6 +30,7 @@ #include <time.h> #include "avformat.h" +#include "avio_internal.h" #include "internal.h" #include "libavutil/avassert.h" @@ -239,8 +240,8 @@ static int segment_start(AVFormatContext *s, int write_header) if ((err = set_segment_filename(s)) < 0) return err; - if ((err = avio_open2(&oc->pb, oc->filename, AVIO_FLAG_WRITE, - &s->interrupt_callback, NULL)) < 0) { + if ((err = ffio_open_whitelist(&oc->pb, oc->filename, AVIO_FLAG_WRITE, + &s->interrupt_callback, NULL, s->protocol_whitelist)) < 0) { av_log(s, AV_LOG_ERROR, "Failed to open segment '%s'\n", oc->filename); return err; } @@ -265,8 +266,8 @@ static int segment_list_open(AVFormatContext *s) int ret; snprintf(seg->temp_list_filename, sizeof(seg->temp_list_filename), seg->use_rename ? "%s.tmp" : "%s", seg->list); - ret = avio_open2(&seg->list_pb, seg->temp_list_filename, AVIO_FLAG_WRITE, - &s->interrupt_callback, NULL); + ret = ffio_open_whitelist(&seg->list_pb, seg->temp_list_filename, AVIO_FLAG_WRITE, + &s->interrupt_callback, NULL, s->protocol_whitelist); if (ret < 0) { av_log(s, AV_LOG_ERROR, "Failed to open segment list '%s'\n", seg->list); return ret; @@ -699,8 +700,8 @@ static int seg_write_header(AVFormatContext *s) goto fail; if (seg->write_header_trailer) { - if ((ret = avio_open2(&oc->pb, seg->header_filename ? seg->header_filename : oc->filename, AVIO_FLAG_WRITE, - &s->interrupt_callback, NULL)) < 0) { + if ((ret = ffio_open_whitelist(&oc->pb, seg->header_filename ? seg->header_filename : oc->filename, AVIO_FLAG_WRITE, + &s->interrupt_callback, NULL, s->protocol_whitelist)) < 0) { av_log(s, AV_LOG_ERROR, "Failed to open segment '%s'\n", oc->filename); goto fail; } @@ -743,8 +744,8 @@ static int seg_write_header(AVFormatContext *s) } else { close_null_ctxp(&oc->pb); } - if ((ret = avio_open2(&oc->pb, oc->filename, AVIO_FLAG_WRITE, - &s->interrupt_callback, NULL)) < 0) + if ((ret = ffio_open_whitelist(&oc->pb, oc->filename, AVIO_FLAG_WRITE, + &s->interrupt_callback, NULL, s->protocol_whitelist)) < 0) goto fail; if (!seg->individual_header_trailer) oc->pb->seekable = 0; |