| 284 | } |
| 285 | |
| 286 | static void |
| 287 | subtitle_add_to_settings(GhbValue *settings, GhbValue *subsettings) |
| 288 | { |
| 289 | // Add the current subtitle settings to the list. |
| 290 | GhbValue *subtitle_list; |
| 291 | gint count; |
| 292 | gboolean burn, forced, def; |
| 293 | gint source; |
| 294 | |
| 295 | subtitle_list = ghb_get_job_subtitle_list(settings); |
| 296 | if (subtitle_list == NULL) |
| 297 | { |
| 298 | g_warning("No subtitle list!"); |
| 299 | return; |
| 300 | } |
| 301 | |
| 302 | // Validate some settings |
| 303 | const char *mux_id; |
| 304 | const hb_container_t *mux; |
| 305 | |
| 306 | mux_id = ghb_dict_get_string(settings, "FileFormat"); |
| 307 | mux = ghb_lookup_container_by_name(mux_id); |
| 308 | |
| 309 | source = get_sub_source(settings, subsettings); |
| 310 | burn = ghb_dict_get_bool(subsettings, "Burn"); |
| 311 | if (burn && !hb_subtitle_can_burn(source)) |
| 312 | { |
| 313 | burn = FALSE; |
| 314 | ghb_dict_set_bool(subsettings, "Burn", burn); |
| 315 | } |
| 316 | if (!burn && !hb_subtitle_can_pass(source, mux->format)) |
| 317 | { |
| 318 | burn = TRUE; |
| 319 | ghb_dict_set_bool(subsettings, "Burn", burn); |
| 320 | ghb_dict_set_bool(subsettings, "Default", FALSE); |
| 321 | } |
| 322 | def = ghb_dict_get_bool(subsettings, "Default"); |
| 323 | forced = ghb_dict_get_bool(subsettings, "Forced"); |
| 324 | if (forced && !hb_subtitle_can_force(source)) |
| 325 | { |
| 326 | forced = FALSE; |
| 327 | ghb_dict_set_bool(subsettings, "Forced", forced); |
| 328 | } |
| 329 | |
| 330 | ghb_array_append(subtitle_list, subsettings); |
| 331 | |
| 332 | // Check consistency of exclusive flags |
| 333 | count = ghb_array_len(subtitle_list); |
| 334 | if (burn) |
| 335 | subtitle_exclusive_burn_settings(settings, count-1); |
| 336 | if (def) |
| 337 | subtitle_exclusive_default_settings(settings, count-1); |
| 338 | } |
| 339 | |
| 340 | static char * |
| 341 | subtitle_get_track_description(GhbValue *settings, GhbValue *subsettings) |
no test coverage detected