- /* add the audio tracks */
- for( i = 0; i < hb_list_count( title->list_audio ); i++ )
- {
- static u_int8_t reserved2[16] = {
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x02, 0x00, 0x10,
- 0x00, 0x00, 0x00, 0x00,
- };
-
- audio = hb_list_item( title->list_audio, i );
- mux_data = malloc( sizeof( hb_mux_data_t ) );
- audio->mux_data = mux_data;
-
- mux_data->track = MP4AddAudioTrack( m->file,
- job->arate, 1024, MP4_MPEG4_AUDIO_TYPE );
- MP4SetAudioProfileLevel( m->file, 0x0F );
- MP4SetTrackESConfiguration( m->file, mux_data->track,
- audio->config.aac.bytes, audio->config.aac.length );
-
- /* Set the language for this track */
- /* The language is stored as 5-bit text - 0x60 */
- language_code = audio->iso639_2[0] - 0x60; language_code <<= 5;
- language_code |= audio->iso639_2[1] - 0x60; language_code <<= 5;
- language_code |= audio->iso639_2[2] - 0x60;
- MP4SetTrackIntegerProperty(m->file, mux_data->track, "mdia.mdhd.language", language_code);
-
- /* Set the correct number of channels for this track */
- reserved2[9] = (u_int8_t)HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(audio->amixdown);
- MP4SetTrackBytesProperty(m->file, mux_data->track, "mdia.minf.stbl.stsd.mp4a.reserved2", reserved2, sizeof(reserved2));
-
- /* If we ever upgrade mpeg4ip, the line above should be replaced with the line below.*/
-// MP4SetTrackIntegerProperty(m->file, mux_data->track, "mdia.minf.stbl.stsd.mp4a.channels", (u_int16_t)HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(audio->amixdown));
-
- /* store a reference to the first audio track,
- so we can use it to feed the chapter text track's sample rate */