/* 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)
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;
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;
}
#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}
};