[FFmpeg-cvslog] lavf/hls: support probesize/max_analyze_duration when open sub-demuxer

Jun Zhao git at videolan.org
Fri Nov 8 05:57:45 EET 2019


ffmpeg | branch: master | Jun Zhao <barryjzhao at tencent.com> | Sat Nov  2 19:48:28 2019 +0800| [5307c12acbafb1640123ab6d9591b3c1ab9d4c5d] | committer: Jun Zhao

lavf/hls: support probesize/max_analyze_duration when open sub-demuxer

Add probesize/max_analyze_duration support when open the sub-demuxer,
it's will be used to minimizing the initial delay.

Signed-off-by: Jun Zhao <barryjzhao at tencent.com>

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

 libavformat/hls.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 8ce1ad9726..17a75e20cd 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1907,6 +1907,8 @@ static int hls_read_header(AVFormatContext *s)
         }
         ffio_init_context(&pls->pb, pls->read_buffer, INITIAL_BUFFER_SIZE, 0, pls,
                           read_data, NULL, NULL);
+        pls->ctx->probesize = s->probesize > 0 ? s->probesize : 1024 * 4;
+        pls->ctx->max_analyze_duration = s->max_analyze_duration > 0 ? s->max_analyze_duration : 4 * AV_TIME_BASE;
         ret = av_probe_input_buffer(&pls->pb, &in_fmt, pls->segments[0]->url,
                                     NULL, 0, 0);
         if (ret < 0) {



More information about the ffmpeg-cvslog mailing list