From: jstebbins Date: Fri, 17 Dec 2010 16:36:22 +0000 (+0000) Subject: cli: allow setting modulus with ana-none X-Git-Url: http://git.osdn.jp/view?a=commitdiff_plain;h=f6c3e5c42a8bb6432177a9b6f92c7f79455d0605;p=handbrake-jp%2Fhandbrake-jp-git.git cli: allow setting modulus with ana-none git-svn-id: svn://localhost/HandBrake/trunk@3711 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/libhb/work.c b/libhb/work.c index 9504d4dd..5944286b 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -237,9 +237,9 @@ void hb_display_job_info( hb_job_t * job ) } else { - hb_log( " + dimensions: %d * %d -> %d * %d, crop %d/%d/%d/%d", + hb_log( " + dimensions: %d * %d -> %d * %d, crop %d/%d/%d/%d, mod %i", title->width, title->height, job->width, job->height, - job->crop[0], job->crop[1], job->crop[2], job->crop[3] ); + job->crop[0], job->crop[1], job->crop[2], job->crop[3], job->modulus ); } if ( job->grayscale ) diff --git a/test/test.c b/test/test.c index 33005406..e8d9d183 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 ); }