| 2239 | } |
| 2240 | |
| 2241 | static 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 |
no test coverage detected