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

Function hb_preset_insert

libhb/preset.c:4844–4875  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4842}
4843
4844int hb_preset_insert(const hb_preset_index_t *path, const hb_value_t *dict)
4845{
4846 hb_value_t *folder = NULL;
4847
4848 if (dict == NULL || path == NULL || path->depth < 0)
4849 return -1;
4850
4851 int index = path->index[path->depth - 1];
4852 hb_preset_index_t folder_path = *path;
4853 folder_path.depth--;
4854 folder = hb_presets_get_folder_children(&folder_path);
4855 if (folder)
4856 {
4857 hb_value_t *dup = hb_value_dup(dict);
4858 presets_clean(dup, hb_preset_template);
4859 if (hb_value_array_len(folder) <= index)
4860 {
4861 index = hb_value_array_len(folder);
4862 hb_value_array_append(folder, dup);
4863 }
4864 else
4865 {
4866 hb_value_array_insert(folder, index, dup);
4867 }
4868 }
4869 else
4870 {
4871 hb_error("hb_preset_insert: not found");
4872 return -1;
4873 }
4874 return index;
4875}
4876
4877int hb_preset_append(const hb_preset_index_t *path, const hb_value_t *dict)
4878{

Callers

nothing calls this directly

Calls 7

hb_value_dupFunction · 0.85
presets_cleanFunction · 0.85
hb_value_array_lenFunction · 0.85
hb_value_array_appendFunction · 0.85
hb_value_array_insertFunction · 0.85
hb_errorFunction · 0.85

Tested by

no test coverage detected