summaryrefslogtreecommitdiffstats
path: root/libhb/muxmp4.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-03-14 01:15:31 +0000
committerjstebbins <[email protected]>2010-03-14 01:15:31 +0000
commit70ce62705b318f5ca12791a87e24065401f844cc (patch)
tree1d753d41b24644f31242e16ea8f2adec0300c97d /libhb/muxmp4.c
parent8412fb04b943ce61befffe2caad64ed786d62415 (diff)
improve lame audio quality by using ABR mode and disabling joint stereo mode
add mp3 muxing into mp4 container. cli and gtk gui now support this. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3167 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/muxmp4.c')
-rw-r--r--libhb/muxmp4.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/libhb/muxmp4.c b/libhb/muxmp4.c
index dcab2e5a6..01ba94004 100644
--- a/libhb/muxmp4.c
+++ b/libhb/muxmp4.c
@@ -347,7 +347,8 @@ static int MP4Init( hb_mux_object_t * m )
(const uint8_t*)(audio->config.out.name),
strlen(audio->config.out.name));
}
- } else {
+ } else if( audio->config.out.codec == HB_ACODEC_FAAC ||
+ audio->config.out.codec == HB_ACODEC_CA_AAC ) {
mux_data->track = MP4AddAudioTrack(
m->file,
audio->config.out.samplerate, 1024, MP4_MPEG4_AUDIO_TYPE );
@@ -376,6 +377,32 @@ static int MP4Init( hb_mux_object_t * m )
/* Set the correct number of channels for this track */
MP4SetTrackIntegerProperty(m->file, mux_data->track, "mdia.minf.stbl.stsd.mp4a.channels", (uint16_t)HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(audio->config.out.mixdown));
+ } else if( audio->config.out.codec == HB_ACODEC_LAME ) {
+ mux_data->track = MP4AddAudioTrack(
+ m->file,
+ audio->config.out.samplerate, 1152, MP4_MPEG2_AUDIO_TYPE );
+
+ /* Tune track chunk duration */
+ MP4TuneTrackDurationPerChunk( m, mux_data->track );
+
+ if (audio->config.out.name == NULL) {
+ MP4SetTrackBytesProperty(
+ m->file, mux_data->track,
+ "udta.name.value",
+ (const uint8_t*)"Stereo", strlen("Stereo"));
+ }
+ else {
+ MP4SetTrackBytesProperty(
+ m->file, mux_data->track,
+ "udta.name.value",
+ (const uint8_t*)(audio->config.out.name),
+ strlen(audio->config.out.name));
+ }
+
+ MP4SetAudioProfileLevel( m->file, 0x0F );
+
+ /* Set the correct number of channels for this track */
+ MP4SetTrackIntegerProperty(m->file, mux_data->track, "mdia.minf.stbl.stsd.mp4a.channels", (uint16_t)HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(audio->config.out.mixdown));
}
/* Set the language for this track */