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

Function hb_subtitle_copy

libhb/common.c:5942–5968  ·  view source on GitHub ↗

* hb_subtitle_copy ********************************************************************** * *********************************************************************/

Source from the content-addressed store, hash-verified

5940 *
5941 *********************************************************************/
5942hb_subtitle_t *hb_subtitle_copy(const hb_subtitle_t *src)
5943{
5944 hb_subtitle_t *subtitle = NULL;
5945
5946 if( src )
5947 {
5948 subtitle = calloc(1, sizeof(*subtitle));
5949 memcpy(subtitle, src, sizeof(*subtitle));
5950 if (src->extradata)
5951 {
5952 subtitle->extradata = hb_data_dup(src->extradata);
5953 }
5954 if (src->name != NULL)
5955 {
5956 subtitle->name = strdup(src->name);
5957 }
5958 if (src->config.name != NULL)
5959 {
5960 subtitle->config.name = strdup(src->config.name);
5961 }
5962 if (src->config.src_filename)
5963 {
5964 subtitle->config.src_filename = strdup(src->config.src_filename);
5965 }
5966 }
5967 return subtitle;
5968}
5969
5970/**********************************************************************
5971 * hb_subtitle_list_copy

Callers 4

hb_add_internalFunction · 0.85
sanitize_subtitlesFunction · 0.85
hb_subtitle_list_copyFunction · 0.85
hb_subtitle_addFunction · 0.85

Calls 1

hb_data_dupFunction · 0.85

Tested by

no test coverage detected