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

Function add_ssa

test/test.c:4967–5003  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4965}
4966
4967static int add_ssa(hb_value_array_t *list, int track, int *one_burned)
4968{
4969 int64_t offset = 0;
4970 char *iso639_2 = "und";
4971 int burn = !*one_burned && ssaburn == track + 1 &&
4972 hb_subtitle_can_burn(IMPORTSRT);
4973 *one_burned |= burn;
4974 int def = ssadefault == track + 1;
4975
4976 if (ssaoffset && track < hb_str_vlen(ssaoffset) && ssaoffset[track])
4977 offset = strtoll(ssaoffset[track], NULL, 0);
4978 if (ssalang && track < hb_str_vlen(ssalang) && ssalang[track])
4979 {
4980 const iso639_lang_t *lang = lang_lookup(ssalang[track]);
4981 if (lang != NULL)
4982 {
4983 iso639_2 = lang->iso639_2;
4984 }
4985 else
4986 {
4987 fprintf(stderr, "Warning: Invalid SRT language (%s)\n",
4988 ssalang[track]);
4989 }
4990 }
4991
4992 hb_dict_t *subtitle_dict = hb_dict_init();
4993 hb_dict_t *ssa_dict = hb_dict_init();
4994 hb_dict_set(subtitle_dict, "Import", ssa_dict);
4995 hb_dict_set(subtitle_dict, "Default", hb_value_bool(def));
4996 hb_dict_set(subtitle_dict, "Burn", hb_value_bool(burn));
4997 hb_dict_set(subtitle_dict, "Offset", hb_value_int(offset));
4998 hb_dict_set(ssa_dict, "Format", hb_value_string("SSA"));
4999 hb_dict_set(ssa_dict, "Filename", hb_value_string(ssafile[track]));
5000 hb_dict_set(ssa_dict, "Language", hb_value_string(iso639_2));
5001 hb_value_array_append(list, subtitle_dict);
5002 return 0;
5003}
5004
5005static int add_audio(hb_value_array_t *list, hb_title_t *title, int track)
5006{

Callers 1

PrepareJobFunction · 0.85

Calls 9

hb_subtitle_can_burnFunction · 0.85
hb_str_vlenFunction · 0.85
lang_lookupFunction · 0.85
hb_dict_initFunction · 0.85
hb_dict_setFunction · 0.85
hb_value_boolFunction · 0.85
hb_value_intFunction · 0.85
hb_value_stringFunction · 0.85
hb_value_array_appendFunction · 0.85

Tested by

no test coverage detected