]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/hls.c
Merge commit '4dc9f00365853b1239936d771856cf1881b5c5ce'
[ffmpeg] / libavformat / hls.c
index 4691a605021360bbb2bcf9a1ce1a05928d060f4d..c16c7708f423c5e7cfc6468043795277c3d093aa 100644 (file)
@@ -482,7 +482,9 @@ static void handle_rendition_args(struct rendition_info *info, const char *key,
 /* used by parse_playlist to allocate a new variant+playlist when the
  * playlist is detected to be a Media Playlist (not Master Playlist)
  * and we have no parent Master Playlist (parsing of which would have
- * allocated the variant and playlist already) */
+ * allocated the variant and playlist already)
+ * *pls == NULL  => Master Playlist or parentless Media Playlist
+ * *pls != NULL => parented Media Playlist, playlist+variant allocated */
 static int ensure_playlist(HLSContext *c, struct playlist **pls, const char *url)
 {
     if (*pls)
@@ -493,8 +495,6 @@ static int ensure_playlist(HLSContext *c, struct playlist **pls, const char *url
     return 0;
 }
 
-/* pls = NULL  => Master Playlist or parentless Media Playlist
- * pls = !NULL => parented Media Playlist, playlist+variant allocated */
 static int open_in(HLSContext *c, AVIOContext **in, const char *url)
 {
     AVDictionary *tmp = NULL;
@@ -516,13 +516,15 @@ static int url_connect(struct playlist *pls, AVDictionary *opts, AVDictionary *o
     av_dict_copy(&tmp, opts, 0);
     av_dict_copy(&tmp, opts2, 0);
 
-    av_opt_set_dict(pls->input, &tmp);
+    if ((ret = av_opt_set_dict(pls->input, &tmp)) < 0)
+        goto fail;
 
     if ((ret = ffurl_connect(pls->input, NULL)) < 0) {
         ffurl_close(pls->input);
         pls->input = NULL;
     }
 
+fail:
     av_dict_free(&tmp);
     return ret;
 }
@@ -1812,7 +1814,7 @@ static int hls_probe(AVProbeData *p)
 #define FLAGS AV_OPT_FLAG_DECODING_PARAM
 static const AVOption hls_options[] = {
     {"live_start_index", "segment index to start live streams at (negative values are from the end)",
-        OFFSET(live_start_index), FF_OPT_TYPE_INT, {.i64 = -3}, INT_MIN, INT_MAX, FLAGS},
+        OFFSET(live_start_index), AV_OPT_TYPE_INT, {.i64 = -3}, INT_MIN, INT_MAX, FLAGS},
     {NULL}
 };