diff options
author | Jun Zhao <barryjzhao@tencent.com> | 2019-09-28 10:45:31 +0800 |
---|---|---|
committer | Jun Zhao <barryjzhao@tencent.com> | 2019-09-30 10:08:16 +0800 |
commit | 541c6356289f5a1dd0390e3dd0a275a0578f01f5 (patch) | |
tree | bec110456477b5c2ab63cefca43d839f2957020b /libavformat/utils.c | |
parent | 12e6057fb005d91b91d706b531f744737208d527 (diff) | |
download | ffmpeg-streaming-541c6356289f5a1dd0390e3dd0a275a0578f01f5.zip ffmpeg-streaming-541c6356289f5a1dd0390e3dd0a275a0578f01f5.tar.gz |
lavf/utils: correct the duration estimation method for nut demuxer
in fact, nut demuxer use the PTS for duration estimation.
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 07f02a7..9d69e3a 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2956,7 +2956,11 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset) /* at least one component has timings - we use them for all * the components */ fill_all_stream_timings(ic); - ic->duration_estimation_method = AVFMT_DURATION_FROM_STREAM; + /* nut demuxer estimate the duration from PTS */ + if(!strcmp(ic->iformat->name, "nut")) + ic->duration_estimation_method = AVFMT_DURATION_FROM_PTS; + else + ic->duration_estimation_method = AVFMT_DURATION_FROM_STREAM; } else { /* less precise: use bitrate info */ estimate_timings_from_bit_rate(ic); |