Commit 75c8d7c2 authored by Mika Raento's avatar Mika Raento Committed by Michael Niedermayer

hlsenc.c, segment.c: propagate defaults to mpegts

This fixes the abnormally high ts overhead in the files produced by the
HLS and segments muxers. See https://trac.ffmpeg.org/ticket/2857 . For
example makes it much more likely that it can produces streams that fit
under the 64kb App store limit.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 0b0d47e4
...@@ -85,14 +85,16 @@ static int hls_mux_init(AVFormatContext *s) ...@@ -85,14 +85,16 @@ static int hls_mux_init(AVFormatContext *s)
{ {
HLSContext *hls = s->priv_data; HLSContext *hls = s->priv_data;
AVFormatContext *oc; AVFormatContext *oc;
int i; int i, ret;
hls->avf = oc = avformat_alloc_context(); ret = avformat_alloc_output_context2(&hls->avf, hls->oformat, NULL, NULL);
if (!oc) if (ret < 0)
return AVERROR(ENOMEM); return ret;
oc = hls->avf;
oc->oformat = hls->oformat; oc->oformat = hls->oformat;
oc->interrupt_callback = s->interrupt_callback; oc->interrupt_callback = s->interrupt_callback;
oc->max_delay = s->max_delay;
av_dict_copy(&oc->metadata, s->metadata, 0); av_dict_copy(&oc->metadata, s->metadata, 0);
for (i = 0; i < s->nb_streams; i++) { for (i = 0; i < s->nb_streams; i++) {
......
...@@ -143,6 +143,7 @@ static int segment_mux_init(AVFormatContext *s) ...@@ -143,6 +143,7 @@ static int segment_mux_init(AVFormatContext *s)
oc = seg->avf; oc = seg->avf;
oc->interrupt_callback = s->interrupt_callback; oc->interrupt_callback = s->interrupt_callback;
oc->max_delay = s->max_delay;
av_dict_copy(&oc->metadata, s->metadata, 0); av_dict_copy(&oc->metadata, s->metadata, 0);
for (i = 0; i < s->nb_streams; i++) { for (i = 0; i < s->nb_streams; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment