| 4965 | } |
| 4966 | |
| 4967 | static 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 | |
| 5005 | static int add_audio(hb_value_array_t *list, hb_title_t *title, int track) |
| 5006 | { |
no test coverage detected