changeset 624:e7b64333f116 libavformat

guess fps for the variable fps case
author michael
date Tue, 21 Dec 2004 02:16:11 +0000
parents 9797489e1700
children 4add6a5abe3e
files utils.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Tue Dec 21 02:01:32 2004 +0000
+++ b/utils.c	Tue Dec 21 02:16:11 2004 +0000
@@ -746,6 +746,7 @@
             int64_t new_diff= ABS(st->cur_dts - pkt->pts);
             if(old_diff < new_diff && old_diff < (pkt->duration>>3)){
                 pkt->pts += pkt->duration;
+//                av_log(NULL, AV_LOG_DEBUG, "id:%d old:%Ld new:%Ld dur:%d cur:%Ld size:%d\n", pkt->stream_index, old_diff, new_diff, pkt->duration, st->cur_dts, pkt->size);
             }
         }
     
@@ -1743,6 +1744,10 @@
             st = ic->streams[i];
             if (!has_codec_parameters(&st->codec))
                 break;
+            /* variable fps and no guess at the real fps */
+            if(   st->codec.frame_rate >= 1000LL*st->codec.frame_rate_base
+               && best_duration[i]== INT64_MAX)
+                break;
         }
         if (i == ic->nb_streams) {
             /* NOTE: if the format has no header, then we need to read