ffmpeg | branch: master | Jun Zhao <barryjz...@tencent.com> | Sat Sep 28 
10:45:31 2019 +0800| [541c6356289f5a1dd0390e3dd0a275a0578f01f5] | committer: 
Jun Zhao

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 <barryjz...@tencent.com>

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

 libavformat/utils.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 07f02a7c94..9d69e3a833 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);

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to