]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/hls.c
avcodec/cuviddec: improve progressive frame detection
[ffmpeg] / libavformat / hls.c
index 8ad08baaed41c5af1f7c0551ddd507069c5eb935..1b61b4b5c0de3767ca8a76714c071a53ebf62adb 100644 (file)
@@ -223,9 +223,9 @@ static void free_segment_dynarray(struct segment **segments, int n_segments)
 
 static void free_segment_list(struct playlist *pls)
 {
-        free_segment_dynarray(pls->segments, pls->n_segments);
-        av_freep(&pls->segments);
-        pls->n_segments = 0;
+    free_segment_dynarray(pls->segments, pls->n_segments);
+    av_freep(&pls->segments);
+    pls->n_segments = 0;
 }
 
 static void free_init_section_list(struct playlist *pls)
@@ -658,7 +658,7 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
         } else if (ret < 0) {
             if (ret != AVERROR_EOF)
                 av_log(s, AV_LOG_WARNING,
-                    "keepalive request failed for '%s', retrying with new connection: %s\n",
+                    "keepalive request failed for '%s' when opening url, retrying with new connection: %s\n",
                     url, av_err2str(ret));
             ret = s->io_open(s, pb, url, AVIO_FLAG_READ, &tmp);
         }
@@ -715,7 +715,7 @@ static int parse_playlist(HLSContext *c, const char *url,
         } else if (ret < 0) {
             if (ret != AVERROR_EOF)
                 av_log(c->ctx, AV_LOG_WARNING,
-                    "keepalive request failed for '%s', retrying with new connection: %s\n",
+                    "keepalive request failed for '%s' when parsing playlist, retrying with new connection: %s\n",
                     url, av_err2str(ret));
             in = NULL;
         }
@@ -931,6 +931,7 @@ static int parse_playlist(HLSContext *c, const char *url,
                    prev_start_seq_no, pls->start_seq_no);
         }
         free_segment_dynarray(prev_segments, prev_n_segments);
+        av_freep(&prev_segments);
     }
     if (pls)
         pls->last_load_time = av_gettime_relative();
@@ -1867,7 +1868,7 @@ static int hls_read_header(AVFormatContext *s)
     /* Open the demuxer for each playlist */
     for (i = 0; i < c->n_playlists; i++) {
         struct playlist *pls = c->playlists[i];
-        AVInputFormat *in_fmt = NULL;
+        ff_const59 AVInputFormat *in_fmt = NULL;
 
         if (!(pls->ctx = avformat_alloc_context())) {
             ret = AVERROR(ENOMEM);
@@ -2284,7 +2285,7 @@ static int hls_read_seek(AVFormatContext *s, int stream_index,
     return 0;
 }
 
-static int hls_probe(AVProbeData *p)
+static int hls_probe(const AVProbeData *p)
 {
     /* Require #EXTM3U at the start, and either one of the ones below
      * somewhere for a proper match. */
@@ -2317,14 +2318,14 @@ static const AVOption hls_options[] = {
 };
 
 static const AVClass hls_class = {
-    .class_name = "hls,applehttp",
+    .class_name = "hls demuxer",
     .item_name  = av_default_item_name,
     .option     = hls_options,
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
 AVInputFormat ff_hls_demuxer = {
-    .name           = "hls,applehttp",
+    .name           = "hls",
     .long_name      = NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming"),
     .priv_class     = &hls_class,
     .priv_data_size = sizeof(HLSContext),