OSDN Git Service

LinGui: make KeepAspect flag differentiate mode 2 and mode 3 anamorphic
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 28 Mar 2009 23:36:41 +0000 (23:36 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 28 Mar 2009 23:36:41 +0000 (23:36 +0000)
git-svn-id: svn://localhost/HandBrake/trunk@2283 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/src/hb-backend.c
gtk/src/makedeps.c

index f0b653b..8a4f046 100644 (file)
@@ -2695,7 +2695,7 @@ ghb_set_scale(signal_user_data_t *ud, gint mode)
 
        if (anamorphic)
        {
-               job->anamorphic.mode = autoscale ? 2 : 3;
+               job->anamorphic.mode = autoscale || keep_aspect ? 2 : 3;
                // The scaler crashes if the dimensions are not divisible by 2
                // Align mod 2.  And so does something in x264_encoder_headers()
                job->anamorphic.modulus = round_dims ? 16 : 2;
@@ -2772,14 +2772,15 @@ set_preview_job_settings(hb_job_t *job, GValue *settings)
        job->crop[2] = ghb_settings_get_int(settings, "PictureLeftCrop");
        job->crop[3] = ghb_settings_get_int(settings, "PictureRightCrop");
 
-       gboolean anamorphic, round_dimensions, autoscale;
+       gboolean anamorphic, round_dimensions, autoscale, keep_aspect;
        autoscale = ghb_settings_get_boolean(settings, "autoscale");
        anamorphic = ghb_settings_get_boolean(settings, "anamorphic");
        round_dimensions = ghb_settings_get_boolean(settings, "ModDimensions");
+       keep_aspect = ghb_settings_get_boolean(settings, "PictureKeepRatio");
        if (anamorphic)
        {
                job->anamorphic.modulus = round_dimensions ? 16 : 2;
-               job->anamorphic.mode = autoscale ? 2 : 3;
+               job->anamorphic.mode = autoscale || keep_aspect ? 2 : 3;
        }
        else
        {
@@ -3307,12 +3308,15 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
                job->deinterlace = 0;
     job->grayscale   = ghb_settings_get_boolean(js, "VideoGrayScale");
 
-       gboolean autoscale = ghb_settings_get_boolean(js, "autoscale");
-       gboolean anamorphic = ghb_settings_get_boolean(js, "anamorphic");
-       gboolean round_dimensions = ghb_settings_get_boolean(js, "ModDimensions");
+       gboolean autoscale, anamorphic, round_dimensions, keep_aspect;
+
+       autoscale = ghb_settings_get_boolean(js, "autoscale");
+       anamorphic = ghb_settings_get_boolean(js, "anamorphic");
+       round_dimensions = ghb_settings_get_boolean(js, "ModDimensions");
+       keep_aspect = ghb_settings_get_boolean(js, "PictureKeepRatio");
        if (anamorphic)
        {
-               job->anamorphic.mode = autoscale ? 2 : 3;
+               job->anamorphic.mode = autoscale || keep_aspect ? 2 : 3;
                // Also, x264 requires things to be divisible by 2.
                job->anamorphic.modulus = round_dimensions ? 16 : 2;
        }
index 386d24a..98b8aee 100644 (file)
@@ -50,7 +50,6 @@ static dependency_t dep_map[] =
        {"PictureAutoCrop", "PictureRightCrop", "FALSE", FALSE, FALSE},
        {"autoscale", "scale_width", "FALSE", FALSE, FALSE},
        {"autoscale", "scale_height", "FALSE", FALSE, FALSE},
-       {"anamorphic", "PictureKeepRatio", "FALSE", FALSE, FALSE},
        // "CHECK" is a dummy value that forces scale_height deps to
        // be re-evaluated whenever anamorphic changes
        {"anamorphic", "scale_height", "CHECK", TRUE, FALSE},