[FFmpeg-devel] [PATCH] Print a warning when using wild guesses as time stamps.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Jan 22 14:12:45 CET 2012


Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
 libavformat/utils.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 9e3f775..dcf773f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3282,6 +3282,11 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){
 
     //XXX/FIXME this is a temporary hack until all encoders output pts
     if((pkt->pts == 0 || pkt->pts == AV_NOPTS_VALUE) && pkt->dts == AV_NOPTS_VALUE && !delay){
+        static int warned;
+        if (!warned) {
+            av_log(s, AV_LOG_WARNING, "Encoder did not produce proper pts, making some up.\n");
+            warned = 1;
+        }
         pkt->dts=
 //        pkt->pts= st->cur_dts;
         pkt->pts= st->pts.val;
-- 
1.7.8.3



More information about the ffmpeg-devel mailing list