[FFmpeg-cvslog] lavf: Do not set cur_dts to undetermined before first_dts has been calculated as this would upset the start_time and first_dts calculation .

Michael Niedermayer git at videolan.org
Thu Nov 3 14:50:46 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Nov  3 14:31:01 2011 +0100| [1ed9eb5a595a46ae6b523bc34a3ed4667a44c6f1] | committer: Michael Niedermayer

lavf: Do not set cur_dts to undetermined before first_dts has been calculated as this would upset the start_time and first_dts calculation.

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

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

 libavformat/utils.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 2cf42d3..333946c 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1415,7 +1415,8 @@ void ff_read_frame_flush(AVFormatContext *s)
             av_free_packet(&st->cur_pkt);
         }
         st->last_IP_pts = AV_NOPTS_VALUE;
-        st->cur_dts = AV_NOPTS_VALUE; /* we set the current DTS to an unspecified origin */
+        if(st->first_dts == AV_NOPTS_VALUE) st->cur_dts = 0;
+        else                                st->cur_dts = AV_NOPTS_VALUE; /* we set the current DTS to an unspecified origin */
         st->reference_dts = AV_NOPTS_VALUE;
         /* fail safe */
         st->cur_ptr = NULL;



More information about the ffmpeg-cvslog mailing list