[FFmpeg-cvslog] lavf/compute_pkt_fields: only run pts by duration correction if reference ts is available

Michael Niedermayer git at videolan.org
Fri Sep 14 20:18:31 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Sep 14 19:46:44 2012 +0200| [e2d643efcd0570b3ee9668024dbe008b9161de58] | committer: Michael Niedermayer

lavf/compute_pkt_fields: only run pts by duration correction if reference ts is available

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 7527784..c6a9e58 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1114,7 +1114,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
                    pkt->duration                ) {
             int duration = pkt->duration;
 
-            if(pkt->pts != AV_NOPTS_VALUE && duration){
+            if(st->cur_dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && duration){
                 int64_t old_diff= FFABS(st->cur_dts - duration - pkt->pts);
                 int64_t new_diff= FFABS(st->cur_dts - pkt->pts);
                 if(   old_diff < new_diff && old_diff < (duration>>3)



More information about the ffmpeg-cvslog mailing list