MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / ghb_get_display_aspect_string

Function ghb_get_display_aspect_string

gtk/src/hb-backend.c:4241–4268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4239}
4240
4241char *
4242ghb_get_display_aspect_string(double disp_width, double disp_height)
4243{
4244 gchar *str;
4245
4246 gint iaspect = disp_width * 9 / disp_height;
4247 if (disp_width / disp_height > 1.9)
4248 {
4249 // x.x:1
4250 str = g_strdup_printf("%.2f:1", disp_width / disp_height);
4251 }
4252 else if (iaspect >= 15)
4253 {
4254 // x.x:9
4255 str = g_strdup_printf("%.4g:9", disp_width * 9 / disp_height);
4256 }
4257 else if (iaspect >= 9)
4258 {
4259 // x.x:3
4260 str = g_strdup_printf("%.4g:3", disp_width * 3 / disp_height);
4261 }
4262 else
4263 {
4264 // 1:x.x
4265 str = g_strdup_printf("1:%.2f", disp_height / disp_width);
4266 }
4267 return str;
4268}
4269
4270static gboolean scale_busy = FALSE;
4271

Callers 3

ghb_set_scale_settingsFunction · 0.85
ghb_update_summary_infoFunction · 0.85
queue_update_summaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected