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@tencent.com>
This commit is contained in:
Jun Zhao 2019-11-02 19:48:28 +08:00
parent d44c7235a8
commit 5307c12acb
1 changed files with 2 additions and 0 deletions

View File

@ -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) {