[FFmpeg-cvslog] estimate_timings_from_pts: Warn about A/ V streams for which no duration could be set

Gaullier Nicolas git at videolan.org
Fri May 16 16:59:08 CEST 2014


ffmpeg | branch: master | Gaullier Nicolas <nicolas.gaullier at arkena.com> | Wed May 14 16:25:13 2014 +0000| [85349d8d00fd117414d47decdd652c1b84a2de63] | committer: Michael Niedermayer

estimate_timings_from_pts: Warn about A/V streams for which no duration could be set

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

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

 libavformat/utils.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index d84d605..fd717b1 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2533,6 +2533,20 @@ static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
              filesize > (DURATION_MAX_READ_SIZE << retry) &&
              ++retry <= DURATION_MAX_RETRY);
 
+    /* warn about audio/video streams which duration could not be estimated */
+    for (i = 0; i < ic->nb_streams; i++) {
+        st = ic->streams[i];
+        if (st->duration == AV_NOPTS_VALUE) {
+            switch (st->codec->codec_type) {
+            case AVMEDIA_TYPE_VIDEO:
+            case AVMEDIA_TYPE_AUDIO:
+                if (st->start_time != AV_NOPTS_VALUE || st->first_dts  != AV_NOPTS_VALUE) {
+                    av_log(ic, AV_LOG_DEBUG, "stream %d : no PTS found at end of file, duration not set\n", i);
+                } else
+                    av_log(ic, AV_LOG_DEBUG, "stream %d : no TS found at start of file, duration not set\n", i);
+            }
+        }
+    }
     fill_all_stream_timings(ic);
 
     avio_seek(ic->pb, old_offset, SEEK_SET);



More information about the ffmpeg-cvslog mailing list