summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-02-26 23:47:32 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-02-26 23:47:32 +0000
commit3797c74ba5350692122a81db62a7bf2ce152f7fc (patch)
tree937ea6305b90b405b4760bcabf0d23de1379a869 /libavformat
parent83569729d461d4a9465ad90d6a6e36eb2c358cb5 (diff)
Add ticks_per_frame, this should hopefully fix the regressions caused
by the time_base change. Originally committed as revision 17630 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 073e6dacdc..4d6cb705f9 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2201,9 +2201,9 @@ int av_find_stream_info(AVFormatContext *ic)
if (!st->r_frame_rate.num){
if( st->codec->time_base.den * (int64_t)st->time_base.num
- <= st->codec->time_base.num * (int64_t)st->time_base.den){
+ <= st->codec->time_base.num * st->codec->ticks_per_frame * (int64_t)st->time_base.den){
st->r_frame_rate.num = st->codec->time_base.den;
- st->r_frame_rate.den = st->codec->time_base.num;
+ st->r_frame_rate.den = st->codec->time_base.num * st->codec->ticks_per_frame;
}else{
st->r_frame_rate.num = st->time_base.den;
st->r_frame_rate.den = st->time_base.num;
@@ -2537,7 +2537,7 @@ static int compute_pkt_fields2(AVStream *st, AVPacket *pkt){
if (pkt->duration == 0) {
compute_frame_duration(&num, &den, st, NULL, pkt);
if (den && num) {
- pkt->duration = av_rescale(1, num * (int64_t)st->time_base.den, den * (int64_t)st->time_base.num);
+ pkt->duration = av_rescale(1, num * (int64_t)st->time_base.den * st->codec->ticks_per_frame, den * (int64_t)st->time_base.num);
}
}