summaryrefslogtreecommitdiffstats
path: root/libhb/hb.c
diff options
context:
space:
mode:
authorjbrjake <[email protected]>2009-06-06 17:02:17 +0000
committerjbrjake <[email protected]>2009-06-06 17:02:17 +0000
commit40399c191cf7c62a590f6fce67f4a2da14e0289a (patch)
tree87f5f8d0937eb1b459526ac51498cce1ac1126d9 /libhb/hb.c
parent7168c40b5207df0a67dc74b34bf0f06ea323c9ae (diff)
Adds a keep_display_aspect toggle to the job->anamorphic struct in order to fix a bug and implements it in the CLI. Also adds some more anamorphic settings to the job config display.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2492 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/hb.c')
-rw-r--r--libhb/hb.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/libhb/hb.c b/libhb/hb.c
index c65cc5872..23119023e 100644
--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -801,11 +801,19 @@ void hb_set_anamorphic_size( hb_job_t * job,
this is an output PAR, to correct a source, and it should not be assumed
that it properly creates a display aspect ratio when applied to the source,
which could easily be stored in a different resolution. */
-
- int output_display_width = width * (double)pixel_aspect_width /
- (double)pixel_aspect_height;
- pixel_aspect_width = output_display_width;
- pixel_aspect_height = width;
+ if( job->anamorphic.keep_display_aspect )
+ {
+ /* We can ignore the possibility of a PAR change */
+ pixel_aspect_width = height * ( (double)source_display_width / (double)cropped_height );
+ pixel_aspect_height = width;
+ }
+ else
+ {
+ int output_display_width = width * (double)pixel_aspect_width /
+ (double)pixel_aspect_height;
+ pixel_aspect_width = output_display_width;
+ pixel_aspect_height = width;
+ }
}
/* Back to caller */