| 4239 | } |
| 4240 | |
| 4241 | char * |
| 4242 | ghb_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 | |
| 4270 | static gboolean scale_busy = FALSE; |
| 4271 |
no outgoing calls
no test coverage detected