summaryrefslogtreecommitdiff
path: root/libavformat/hlsproto.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/hlsproto.c')
-rw-r--r--libavformat/hlsproto.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/libavformat/hlsproto.c b/libavformat/hlsproto.c
index 4c3048a790..2b19ed0cf6 100644
--- a/libavformat/hlsproto.c
+++ b/libavformat/hlsproto.c
@@ -2,20 +2,20 @@
* Apple HTTP Live Streaming Protocol Handler
* Copyright (c) 2010 Martin Storsjo
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -28,6 +28,7 @@
#include "libavutil/avstring.h"
#include "libavutil/time.h"
#include "avformat.h"
+#include "avio_internal.h"
#include "internal.h"
#include "url.h"
#include "version.h"
@@ -80,7 +81,7 @@ static void free_segment_list(HLSContext *s)
{
int i;
for (i = 0; i < s->n_segments; i++)
- av_free(s->segments[i]);
+ av_freep(&s->segments[i]);
av_freep(&s->segments);
s->n_segments = 0;
}
@@ -89,7 +90,7 @@ static void free_variant_list(HLSContext *s)
{
int i;
for (i = 0; i < s->n_variants; i++)
- av_free(s->variants[i]);
+ av_freep(&s->variants[i]);
av_freep(&s->variants);
s->n_variants = 0;
}
@@ -116,8 +117,9 @@ static int parse_playlist(URLContext *h, const char *url)
char line[1024];
const char *ptr;
- if ((ret = avio_open2(&in, url, AVIO_FLAG_READ,
- &h->interrupt_callback, NULL)) < 0)
+ if ((ret = ffio_open_whitelist(&in, url, AVIO_FLAG_READ,
+ &h->interrupt_callback, NULL,
+ h->protocol_whitelist, h->protocol_blacklist)) < 0)
return ret;
read_chomp_line(in, line, sizeof(line));
@@ -128,7 +130,7 @@ static int parse_playlist(URLContext *h, const char *url)
free_segment_list(s);
s->finished = 0;
- while (!in->eof_reached) {
+ while (!avio_feof(in)) {
read_chomp_line(in, line, sizeof(line));
if (av_strstart(line, "#EXT-X-STREAM-INF:", &ptr)) {
struct variant_info info = {{0}};
@@ -303,8 +305,9 @@ retry:
}
url = s->segments[s->cur_seq_no - s->start_seq_no]->url,
av_log(h, AV_LOG_DEBUG, "opening %s\n", url);
- ret = ffurl_open(&s->seg_hd, url, AVIO_FLAG_READ,
- &h->interrupt_callback, NULL, h->protocols, h);
+ ret = ffurl_open_whitelist(&s->seg_hd, url, AVIO_FLAG_READ,
+ &h->interrupt_callback, NULL,
+ h->protocol_whitelist, h->protocol_blacklist, h);
if (ret < 0) {
if (ff_check_interrupt(&h->interrupt_callback))
return AVERROR_EXIT;