diff options
Diffstat (limited to 'libavformat/hlsenc.c')
-rw-r--r-- | libavformat/hlsenc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 8b180dce5a..0525e70b30 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -85,14 +85,16 @@ static int hls_mux_init(AVFormatContext *s) { HLSContext *hls = s->priv_data; AVFormatContext *oc; - int i; + int i, ret; - hls->avf = oc = avformat_alloc_context(); - if (!oc) - return AVERROR(ENOMEM); + ret = avformat_alloc_output_context2(&hls->avf, hls->oformat, NULL, NULL); + if (ret < 0) + return ret; + oc = hls->avf; oc->oformat = hls->oformat; oc->interrupt_callback = s->interrupt_callback; + oc->max_delay = s->max_delay; av_dict_copy(&oc->metadata, s->metadata, 0); for (i = 0; i < s->nb_streams; i++) { |