summaryrefslogtreecommitdiffstats
path: root/gtk/src/hb-backend.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2008-10-18 23:48:53 +0000
committerjstebbins <[email protected]>2008-10-18 23:48:53 +0000
commit3c199946f7eb66a581454aa60392dba8cc174d7e (patch)
tree08e02e136d9efa1c174292497efb84e3824f92fc /gtk/src/hb-backend.c
parent152ec1f0a7350d70e87a0a265f806b5400ce4ae0 (diff)
LinGui: add pref option to scale down high def previews
when this option is enabled, if the preview dims are above a threshold then the size is scaled down to no larger than 1280x720. 1080p previews are too big for my laptop :-P git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1846 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/hb-backend.c')
-rw-r--r--gtk/src/hb-backend.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index b69083818..98c27dc20 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -3453,6 +3453,9 @@ ghb_pause_queue()
}
}
+#define RED_HEIGHT 720.0
+#define RED_WIDTH 1280.0
+
GdkPixbuf*
ghb_get_preview_image(
gint titleindex,
@@ -3589,6 +3592,21 @@ ghb_get_preview_image(
else
dstHeight = dstHeight * par_height / par_width;
}
+ if (ghb_settings_get_boolean(settings, "reduce_hd_preview"))
+ {
+ gdouble factor = 1.0;
+
+ if (dstHeight > RED_HEIGHT)
+ {
+ factor = RED_HEIGHT / (gdouble)dstHeight;
+ }
+ if (dstWidth * factor > RED_WIDTH)
+ {
+ factor = RED_WIDTH / (gdouble)dstWidth;
+ }
+ dstHeight = dstHeight * factor + 0.5;
+ dstWidth = dstWidth * factor + 0.5;
+ }
g_debug("scaled %d x %d\n", dstWidth, dstHeight);
GdkPixbuf *scaled_preview;