[FFmpeg-cvslog] lavf: initialize cur_dts to AV_NOPTS_VALUE for muxing

Anton Khirnov git at videolan.org
Tue Nov 10 18:24:29 CET 2015


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Oct  7 11:48:28 2015 +0200| [a0c71a575109f123978e345fa7eb4ac03cd4d3c3] | committer: Anton Khirnov

lavf: initialize cur_dts to AV_NOPTS_VALUE for muxing

The reasoning for setting it to zero only applies to demuxing.

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

 libavformat/utils.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 42f60d5..1fe7c6f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2549,16 +2549,18 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
 
         /* default pts setting is MPEG-like */
         avpriv_set_pts_info(st, 33, 1, 90000);
+        /* we set the current DTS to 0 so that formats without any timestamps
+         * but durations get some timestamps, formats with some unknown
+         * timestamps have their first few packets buffered and the
+         * timestamps corrected before they are returned to the user */
+        st->cur_dts = 0;
+    } else {
+        st->cur_dts = AV_NOPTS_VALUE;
     }
 
     st->index      = s->nb_streams;
     st->start_time = AV_NOPTS_VALUE;
     st->duration   = AV_NOPTS_VALUE;
-    /* we set the current DTS to 0 so that formats without any timestamps
-     * but durations get some timestamps, formats with some unknown
-     * timestamps have their first few packets buffered and the
-     * timestamps corrected before they are returned to the user */
-    st->cur_dts       = 0;
     st->first_dts     = AV_NOPTS_VALUE;
     st->probe_packets = MAX_PROBE_PACKETS;
 



More information about the ffmpeg-cvslog mailing list