diff options
author | saintdev <no-reply@handbrake.fr> | 2007-03-26 19:38:24 +0000 |
---|---|---|
committer | saintdev <no-reply@handbrake.fr> | 2007-03-26 19:38:24 +0000 |
commit | 5b4288a0466445f060e9897ead19a970724dc8c1 (patch) | |
tree | b7db565592eefdc51db8d448fc9cd23d9d4cf73a /libhb/muxmp4.c | |
parent | 03670893ccd2c2c20081cf57797bf925503762ee (diff) |
Keep the language id for each audio track when using MP4.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@454 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/muxmp4.c')
-rw-r--r-- | libhb/muxmp4.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libhb/muxmp4.c b/libhb/muxmp4.c index 458de7be3..f06527295 100644 --- a/libhb/muxmp4.c +++ b/libhb/muxmp4.c @@ -44,6 +44,7 @@ static int MP4Init( hb_mux_object_t * m ) hb_audio_t * audio; hb_mux_data_t * mux_data; int i; + u_int16_t language_code; /* Create an empty mp4 file */ m->file = MP4Create( job->file, MP4_DETAILS_ERROR, 0 ); @@ -164,6 +165,13 @@ static int MP4Init( hb_mux_object_t * m ) 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); /* store a reference to the first audio track, so we can use it to feed the chapter text track's sample rate */ |