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

Function hb_init_audio_list

libhb/stream.c:2241–2276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2239}
2240
2241static void hb_init_audio_list(hb_stream_t *stream, hb_title_t *title)
2242{
2243 int ii;
2244 int map_idx;
2245 int largest = -1;
2246
2247 // First add all that were found in a map.
2248 for ( map_idx = 0; 1; map_idx++ )
2249 {
2250 for ( ii = 0; ii < stream->pes.count; ii++ )
2251 {
2252 if ( stream->pes.list[ii].stream_kind == A )
2253 {
2254 if ( stream->pes.list[ii].map_idx == map_idx )
2255 {
2256 pes_add_audio_to_title( stream, ii, title, -1 );
2257 }
2258 if ( stream->pes.list[ii].map_idx > largest )
2259 largest = stream->pes.list[ii].map_idx;
2260 }
2261 }
2262 if ( map_idx > largest )
2263 break;
2264 }
2265
2266 int count = hb_list_count( title->list_audio );
2267 // Now add the reset. Sort them by stream id.
2268 for ( ii = 0; ii < stream->pes.count; ii++ )
2269 {
2270 if ( stream->pes.list[ii].stream_kind == A )
2271 {
2272 pes_add_audio_to_title( stream, ii, title, count );
2273 }
2274 }
2275 pes_set_audio_indices(title);
2276}
2277
2278/***********************************************************************
2279 * hb_ts_stream_init

Callers 1

hb_stream_title_scanFunction · 0.85

Calls 3

pes_add_audio_to_titleFunction · 0.85
hb_list_countFunction · 0.85
pes_set_audio_indicesFunction · 0.85

Tested by

no test coverage detected