| 44 | static void subtitle_edit_response(GtkWidget *dialog, int response, GhbValue *backup); |
| 45 | |
| 46 | static int get_sub_source(GhbValue *settings, GhbValue *subsettings) |
| 47 | { |
| 48 | GhbValue *import; |
| 49 | |
| 50 | import = ghb_dict_get(subsettings, "Import"); |
| 51 | if (import != NULL) |
| 52 | { |
| 53 | const char * format = ghb_dict_get_string(import, "Format"); |
| 54 | if (format != NULL && !strcasecmp(format, "SSA")) |
| 55 | { |
| 56 | return IMPORTSSA; |
| 57 | } |
| 58 | return IMPORTSRT; |
| 59 | } |
| 60 | |
| 61 | int title_id = ghb_dict_get_int(settings, "title"); |
| 62 | const hb_title_t *title = ghb_lookup_title(title_id, NULL); |
| 63 | if (title == NULL) // No title, scan failure? |
| 64 | return VOBSUB; |
| 65 | |
| 66 | GhbValue *val = ghb_dict_get(subsettings, "Track"); |
| 67 | if (val == NULL) // No track, foreign audio search |
| 68 | return VOBSUB; |
| 69 | |
| 70 | int track = ghb_dict_get_int(subsettings, "Track"); |
| 71 | hb_subtitle_t *subtitle = hb_list_item(title->list_subtitle, track); |
| 72 | if (subtitle != NULL) // Invalid track, shouldn't happen |
| 73 | return subtitle->source; |
| 74 | |
| 75 | return VOBSUB; |
| 76 | } |
| 77 | |
| 78 | static void |
| 79 | subtitle_refresh_list_row_ui( |
no test coverage detected