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

Function hb_subtitle_add

libhb/common.c:6079–6099  ·  view source on GitHub ↗

* hb_subtitle_add ********************************************************************** * *********************************************************************/

Source from the content-addressed store, hash-verified

6077 *
6078 *********************************************************************/
6079int hb_subtitle_add(const hb_job_t * job, const hb_subtitle_config_t * subtitlecfg, int track)
6080{
6081 hb_title_t *title = job->title;
6082 hb_subtitle_t *subtitle;
6083
6084 subtitle = hb_subtitle_copy( hb_list_item( title->list_subtitle, track ) );
6085 if( subtitle == NULL )
6086 {
6087 /* We fail! */
6088 return 0;
6089 }
6090
6091 // "track" in title->list_audio is an index into the source's tracks.
6092 // "track" in job->list_audio is an index into title->list_audio
6093 subtitle->track = track;
6094 hb_subtitle_config_copy(&subtitle->config, subtitlecfg);
6095 subtitle->config.src_filename = NULL;
6096 subtitle->out_track = hb_list_count(job->list_subtitle) + 1;
6097 hb_list_add(job->list_subtitle, subtitle);
6098 return 1;
6099}
6100
6101int hb_import_subtitle_add( const hb_job_t * job,
6102 const hb_subtitle_config_t * subtitlecfg,

Callers 1

hb_dict_to_jobFunction · 0.85

Calls 5

hb_subtitle_copyFunction · 0.85
hb_list_itemFunction · 0.85
hb_subtitle_config_copyFunction · 0.85
hb_list_countFunction · 0.85
hb_list_addFunction · 0.85

Tested by

no test coverage detected