diff options
-rw-r--r-- | libhb/hb.c | 2 | ||||
-rw-r--r-- | libhb/scan.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libhb/hb.c b/libhb/hb.c index 058924848..31b45c2df 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -589,7 +589,7 @@ void hb_set_anamorphic_size( hb_job_t * job, if ( job->maxWidth && (job->maxWidth < job->width) ) width = job->maxWidth; - height = (double)width / storage_aspect; + height = ((double)width / storage_aspect) + 0.5; if ( job->maxHeight && (job->maxHeight < height) ) height = job->maxHeight; diff --git a/libhb/scan.c b/libhb/scan.c index 631fa43ef..6459c1d50 100644 --- a/libhb/scan.c +++ b/libhb/scan.c @@ -200,7 +200,7 @@ static void ScanFunc( void * _data ) !job->pixel_aspect_width && !job->pixel_aspect_height) { hb_reduce( &job->pixel_aspect_width, &job->pixel_aspect_height, - (int)(title->aspect * title->height), title->width ); + (int)(title->aspect * title->height + 0.5), title->width ); } job->width = title->width - job->crop[2] - job->crop[3]; @@ -686,14 +686,14 @@ skip_preview: // aspect ratio from the DVD metadata. So, if the aspect computed // from the PAR is different from the container's aspect we use // the container's aspect & recompute the PAR from it. - if( title->container_aspect && title->aspect != title->container_aspect ) + if( title->container_aspect && (int)(title->aspect * 9) != (int)(title->container_aspect * 9) ) { hb_log("scan: content PAR gives wrong aspect %.2f; " "using container aspect %.2f", title->aspect, title->container_aspect ); title->aspect = title->container_aspect; hb_reduce( &title->pixel_aspect_width, &title->pixel_aspect_height, - (int)(title->aspect * title->height), title->width ); + (int)(title->aspect * title->height + 0.5), title->width ); } } |