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 /test/test.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 'test/test.c')
-rw-r--r-- | test/test.c | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/test/test.c b/test/test.c index 36fac4e9c..2ab159488 100644 --- a/test/test.c +++ b/test/test.c @@ -1184,13 +1184,6 @@ static int HandleEvents( hb_handle_t * h ) { hb_filter_detelecine.settings = detelecine_opt; hb_list_add( job->filters, &hb_filter_detelecine ); - - if( !vrate ) - { - /* No framerate specified, so using same as source. - That means VFR, so set detelecine up to drop frames. */ - job->vfr = 1; - } } if( decomb ) { @@ -1264,10 +1257,18 @@ static int HandleEvents( hb_handle_t * h ) } if( vrate ) { - job->cfr = 1; + job->cfr = cfr; job->vrate = 27000000; job->vrate_base = vrate; } + else if ( cfr ) + { + // cfr or pfr flag with no rate specified implies + // use the title rate. + job->cfr = cfr; + job->vrate = title->rate; + job->vrate_base = title->rate_base; + } /* Grab audio tracks */ if( atracks ) @@ -1970,6 +1971,16 @@ static void ShowHelp() " Be aware that not specifying a framerate lets\n" " HandBrake preserve a source's time stamps,\n" " potentially creating variable framerate video\n" + " --vfr, --cfr, --pfr Select variable, constant or peak-limited\n" + " frame rate control. VFR preserves the source\n" + " timing. CFR makes the output constant rate at\n" + " the rate given by the -r flag (or the source's\n" + " average rate if no -r is given). PFR doesn't\n" + " allow the rate to go over the rate specified\n" + " with the -r flag but won't change the source\n" + " timing if it's below that rate.\n" + " If none of these flags are given, the default\n" + " is --cfr when -r is given and --vfr otherwise\n" "\n" "### Audio Options-----------------------------------------------------------\n\n" @@ -2201,7 +2212,9 @@ static int ParseOptions( int argc, char ** argv ) { "previews", required_argument, NULL, PREVIEWS }, { "start-at-preview", required_argument, NULL, START_AT_PREVIEW }, { "stop-at", required_argument, NULL, STOP_AT }, - + { "vfr", no_argument, &cfr, 0 }, + { "cfr", no_argument, &cfr, 1 }, + { "pfr", no_argument, &cfr, 2 }, { 0, 0, 0, 0 } }; @@ -2218,6 +2231,9 @@ static int ParseOptions( int argc, char ** argv ) switch( c ) { + case 0: + /* option was handled entirely in getopt_long */ + break; case 'h': ShowHelp(); exit( 0 ); @@ -2507,6 +2523,10 @@ static int ParseOptions( int argc, char ** argv ) { fprintf( stderr, "invalid framerate %s\n", optarg ); } + else if ( cfr == 0 ) + { + cfr = 1; + } break; } case 'R': |