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

Function add_subtitle

libhb/bd.c:98–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98static void add_subtitle(int track, hb_list_t *list_subtitle, BLURAY_STREAM_INFO *bdsub, uint32_t codec, uint32_t codec_param)
99{
100 hb_subtitle_t * subtitle;
101 iso639_lang_t * lang;
102
103 subtitle = calloc( sizeof( hb_subtitle_t ), 1 );
104
105 subtitle->track = track;
106 subtitle->id = bdsub->pid;
107
108 switch ( bdsub->coding_type )
109 {
110 case BLURAY_STREAM_TYPE_SUB_PG:
111 subtitle->source = PGSSUB;
112 subtitle->format = PICTURESUB;
113 subtitle->config.dest = RENDERSUB;
114 break;
115 default:
116 // Unrecognized, don't add to list
117 free( subtitle );
118 return;
119 }
120 lang = lang_for_code2( (char*)bdsub->lang );
121 snprintf(subtitle->lang, sizeof( subtitle->lang ), "%s (%s)",
122 strlen(lang->native_name) ? lang->native_name : lang->eng_name,
123 hb_subsource_name(subtitle->source));
124 snprintf(subtitle->iso639_2, sizeof( subtitle->iso639_2 ), "%s",
125 lang->iso639_2);
126
127 subtitle->reg_desc = STR4_TO_UINT32("HDMV");
128 subtitle->stream_type = bdsub->coding_type;
129 subtitle->codec = codec;
130 subtitle->codec_param = codec_param;
131 subtitle->timebase.num = 1;
132 subtitle->timebase.den = 90000;
133
134 hb_log( "bd: subtitle id=0x%x, lang=%s, 3cc=%s", subtitle->id,
135 subtitle->lang, subtitle->iso639_2 );
136
137 hb_list_add( list_subtitle, subtitle );
138 return;
139}
140
141static void add_audio(int index, int linked_index, int track, hb_list_t *list_audio, BLURAY_STREAM_INFO *bdaudio, int substream_type, uint32_t codec, uint32_t codec_param, int attributes)
142{

Callers 1

hb_bd_title_scanFunction · 0.70

Calls 4

lang_for_code2Function · 0.85
hb_subsource_nameFunction · 0.85
hb_logFunction · 0.85
hb_list_addFunction · 0.85

Tested by

no test coverage detected