summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authoreddyg <[email protected]>2008-02-14 02:19:09 +0000
committereddyg <[email protected]>2008-02-14 02:19:09 +0000
commit39212ff7d8ac8f72b59196e38e5173b8ec503f6a (patch)
tree7bdc4a4c00753e7da8d32b06cdaf6e25fdac4ef4 /libhb
parent550c8afa6360c157906fa1067b54327fb6797ecf (diff)
AC3 from DVD via HB converted to M4V for viewing on ATV
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1261 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/muxmp4.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/libhb/muxmp4.c b/libhb/muxmp4.c
index 0959c6e48..f91482ee6 100644
--- a/libhb/muxmp4.c
+++ b/libhb/muxmp4.c
@@ -303,12 +303,34 @@ static int MP4Init( hb_mux_object_t * m )
mux_data = malloc( sizeof( hb_mux_data_t ) );
audio->mux_data = mux_data;
- mux_data->track = MP4AddAudioTrack( m->file,
+ if( job->acodec & HB_ACODEC_AC3 )
+ {
+ mux_data->track = MP4AddAC3AudioTrack(
+ m->file,
+ job->arate, 1536, MP4_MPEG4_AUDIO_TYPE );
+ MP4SetTrackBytesProperty(
+ m->file, mux_data->track,
+ "udta.name.value",
+ (const u_int8_t*)"Surround", strlen("Surround"));
+ } else {
+ mux_data->track = MP4AddAudioTrack(
+ m->file,
job->arate, 1024, MP4_MPEG4_AUDIO_TYPE );
- MP4SetAudioProfileLevel( m->file, 0x0F );
- MP4SetTrackESConfiguration( m->file, mux_data->track,
+ MP4SetTrackBytesProperty(
+ m->file, mux_data->track,
+ "udta.name.value",
+ (const u_int8_t*)"Stereo", strlen("Stereo"));
+
+ MP4SetAudioProfileLevel( m->file, 0x0F );
+ MP4SetTrackESConfiguration(
+ m->file, mux_data->track,
audio->config.aac.bytes, audio->config.aac.length );
-
+
+ /* 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));
+
+ }
/* 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;
@@ -316,9 +338,6 @@ static int MP4Init( hb_mux_object_t * m )
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));
/* Set the audio track alternate group */
MP4SetTrackIntegerProperty(m->file, mux_data->track, "tkhd.alternate_group", 1);