summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMika Raento <mikie@iki.fi>2014-10-17 19:28:47 +0300
committerMichael Niedermayer <michaelni@gmx.at>2014-10-17 21:31:25 +0200
commit75c8d7c2b4972f6ba2cef605949f57322f7c0361 (patch)
tree0a637f5c77a2e2bc488fac4bf82a126c26a8ceca
parent0b0d47e4b21e8936707183967d840f64ba055cb2 (diff)
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: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/hlsenc.c10
-rw-r--r--libavformat/segment.c1
2 files changed, 7 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++) {
diff --git a/libavformat/segment.c b/libavformat/segment.c
index 6183208fa2..9db2607018 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -143,6 +143,7 @@ static int segment_mux_init(AVFormatContext *s)
oc = seg->avf;
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++) {