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

Function get_sub_source

gtk/src/subtitlehandler.c:46–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44static void subtitle_edit_response(GtkWidget *dialog, int response, GhbValue *backup);
45
46static 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
78static void
79subtitle_refresh_list_row_ui(

Callers 3

subtitle_add_to_settingsFunction · 0.85
ghb_subtitle_pruneFunction · 0.85

Calls 4

ghb_dict_get_stringFunction · 0.85
ghb_dict_get_intFunction · 0.85
ghb_lookup_titleFunction · 0.85
hb_list_itemFunction · 0.85

Tested by

no test coverage detected