summaryrefslogtreecommitdiffstats
path: root/libhb/decavcodec.c
diff options
context:
space:
mode:
authorvan <[email protected]>2009-04-01 04:40:08 +0000
committervan <[email protected]>2009-04-01 04:40:08 +0000
commit687930925f509a27928887d34546d7bea87b99a3 (patch)
tree888a15e084cb08b9c9a1896a29ce8edd45cabc54 /libhb/decavcodec.c
parent9091b70897f91be9f058b1369cf8fc9452b7ad5a (diff)
Fix frame rate calculation for ffmpeg 0.5 - h.264 rate is now in fields per second so convert it back to frames per second.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2288 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/decavcodec.c')
-rw-r--r--libhb/decavcodec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c
index e5c8fd10c..532059706 100644
--- a/libhb/decavcodec.c
+++ b/libhb/decavcodec.c
@@ -895,6 +895,12 @@ static int decavcodecvInfo( hb_work_object_t *w, hb_work_info_t *info )
info->rate = 27000000;
info->rate_base = (int64_t)context->time_base.num * 27000000LL /
context->time_base.den;
+ if ( context->ticks_per_frame > 1 )
+ {
+ // for ffmpeg 0.5 & later, the H.264 & MPEG-2 time base is
+ // field rate rather than frame rate so convert back to frames.
+ info->rate_base *= context->ticks_per_frame;
+ }
/* Sometimes there's no pixel aspect set in the source. In that case,
assume a 1:1 PAR. Otherwise, preserve the source PAR. */