changeset 3332:74e2cfc79cda libavformat

Warn user about invalid timestamps.
author michael
date Fri, 23 May 2008 17:52:42 +0000
parents f89173ea4c5e
children 8bec7ae8f0bb
files utils.c
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Fri May 23 13:52:54 2008 +0000
+++ b/utils.c	Fri May 23 17:52:42 2008 +0000
@@ -850,6 +850,18 @@
                 return ret;
             }
 
+            if(s->cur_pkt.pts != AV_NOPTS_VALUE &&
+               s->cur_pkt.dts != AV_NOPTS_VALUE &&
+               s->cur_pkt.pts < s->cur_pkt.dts){
+                av_log(s, AV_LOG_WARNING, "Invalid timestamps stream=%d, pts=%"PRId64", dts=%"PRId64", size=%d\n",
+                    s->cur_pkt.stream_index,
+                    s->cur_pkt.pts,
+                    s->cur_pkt.dts,
+                    s->cur_pkt.size);
+//                av_free_packet(&s->cur_pkt);
+//                return -1;
+            }
+
             st = s->streams[s->cur_pkt.stream_index];
             if(st->codec->debug & FF_DEBUG_PTS)
                 av_log(s, AV_LOG_DEBUG, "av_read_packet stream=%d, pts=%"PRId64", dts=%"PRId64", size=%d\n",