summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-12-21 02:16:11 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-12-21 02:16:11 +0000
commit3e76d1b526276e0c8e767a7e60b9c78a5baf3adb (patch)
tree5782afc49c59c2d9a863f5c086bbbc46ff3a5dbc /libavformat
parent6260de6ab09a7be7195a9085c04e2646d20ac142 (diff)
guess fps for the variable fps case
Originally committed as revision 3768 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index efed2e41de..be0ef6538d 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -746,6 +746,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
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 @@ int av_find_stream_info(AVFormatContext *ic)
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