From 48a59dfe8e2483b201adfa4ceead3755eb8bf824 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Sat, 4 Aug 2007 22:54:46 +0000
Subject: [PATCH] set a more reasonable start_time if the first timestamps are
 AV_NOPTS_VALUE

Originally committed as revision 9918 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavformat/utils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index c4ade6f33e4..b5693b5da37 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -608,6 +608,9 @@ static void update_initial_timestamps(AVFormatContext *s, int stream_index, int6
 
         if(pktl->pkt.dts != AV_NOPTS_VALUE)
             pktl->pkt.dts += st->first_dts;
+
+        if(st->start_time == AV_NOPTS_VALUE && pktl->pkt.pts != AV_NOPTS_VALUE)
+            st->start_time= pktl->pkt.pts;
     }
 }
 
-- 
GitLab