diff options
author | van <[email protected]> | 2009-05-02 21:28:39 +0000 |
---|---|---|
committer | van <[email protected]> | 2009-05-02 21:28:39 +0000 |
commit | 2272709a6a704674f1beb441b703f673c543691c (patch) | |
tree | d12b7b899d02ad8f3ef9315991ccc08dcc383b84 /libhb/work.c | |
parent | e5aaf58dc69573414ca03f5721768dc8557d93cf (diff) |
- Move frame rate code from sync to the end of render so it can account for frame timing changes made by filters.
- Fix a bug that would make CFR alternate between massive drops and massive dups on
some titles.
- If we're not doing CFR add a factor-of-two fudge factor to init_delay to account f
or the awful clock resolution of some mkvs and mp4s.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2368 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/work.c')
-rw-r--r-- | libhb/work.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/libhb/work.c b/libhb/work.c index 4cd9ffe6e..8e0734ceb 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -186,20 +186,19 @@ void hb_display_job_info( hb_job_t * job ) hb_log( " + bitrate %d kbps", title->video_bitrate / 1000 ); } - if( job->vfr) - { - hb_log( " + frame rate: %.3f fps -> variable fps", - (float) title->rate / (float) title->rate_base ); - } - else if( !job->cfr ) + if( !job->cfr ) { hb_log( " + frame rate: same as source (around %.3f fps)", (float) title->rate / (float) title->rate_base ); } else { - hb_log( " + frame rate: %.3f fps -> constant %.3f fps", - (float) title->rate / (float) title->rate_base, (float) job->vrate / (float) job->vrate_base ); + static const char *frtypes[] = { + "", "constant", "peak rate limited to" + }; + hb_log( " + frame rate: %.3f fps -> %s %.3f fps", + (float) title->rate / (float) title->rate_base, frtypes[job->cfr], + (float) job->vrate / (float) job->vrate_base ); } if( job->anamorphic.mode ) @@ -402,16 +401,19 @@ static void do_job( hb_job_t * job, int cpu_count ) hb_log( "New dimensions %i * %i", job->width, job->height ); } - if( ( job->mux & HB_MUX_AVI ) || job->cfr ) + if( job->mux & HB_MUX_AVI ) { - /* VFR detelecine is not compatible with AVI or constant frame rates. */ - job->vfr = 0; + // The concept of variable frame rate video was a bit too advanced + // for Microsoft so AVI doesn't support it. Since almost all dvd + // video is VFR we have to convert it to constant frame rate to + // put it in an AVI container. So duplicate, drop and + // otherwise trash video frames to appease the gods of Redmond. + job->cfr = 1; } - if ( job->vfr ) + if ( job->cfr == 0 ) { - /* Ensure we're using "Same as source" FPS, - aka VFR, if we're doing VFR detelecine. */ + /* Ensure we're using "Same as source" FPS */ job->vrate_base = title->rate_base; } |