[FFmpeg-cvslog] hlsenc.c, segment.c: propagate defaults to mpegts

Mika Raento git at videolan.org
Fri Oct 17 22:17:23 CEST 2014


ffmpeg | branch: master | Mika Raento <mikie at iki.fi> | Fri Oct 17 19:28:47 2014 +0300| [75c8d7c2b4972f6ba2cef605949f57322f7c0361] | committer: 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: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=75c8d7c2b4972f6ba2cef605949f57322f7c0361
---

 libavformat/hlsenc.c  |   10 ++++++----
 libavformat/segment.c |    1 +
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 8b180dc..0525e70 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 6183208..9db2607 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++) {



More information about the ffmpeg-cvslog mailing list