From 78daf7e4c8d295caad815ec2ec09763b5779dfff Mon Sep 17 00:00:00 2001 From: jstebbins Date: Fri, 17 Dec 2010 16:36:22 +0000 Subject: cli: allow setting modulus with ana-none git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3711 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- test/test.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') diff --git a/test/test.c b/test/test.c index 330054063..e8d9d183b 100644 --- a/test/test.c +++ b/test/test.c @@ -1285,6 +1285,11 @@ static int HandleEvents( hb_handle_t * h ) { case 0: // Non-anamorphic + if (modulus) + { + job->modulus = modulus; + } + if( width && height ) { job->width = width; @@ -1293,15 +1298,27 @@ static int HandleEvents( hb_handle_t * h ) else if( width ) { job->width = width; + // do not exceed source dimensions by default + if( !maxHeight ) + job->maxHeight = title->height; hb_fix_aspect( job, HB_KEEP_WIDTH ); } else if( height ) { job->height = height; + // do not exceed source dimensions by default + if( !maxWidth ) + job->maxWidth = title->width; hb_fix_aspect( job, HB_KEEP_HEIGHT ); } else if( !width && !height ) { + /* Default to cropped width when one isn't specified + * avoids rounding to mod 16 regardless of modulus */ + job->width = title->width - job->crop[2] - job->crop[3]; + // do not exceed source dimensions by default + if( !maxHeight ) + job->maxHeight = title->height; hb_fix_aspect( job, HB_KEEP_WIDTH ); } -- cgit v1.2.3