summaryrefslogtreecommitdiffstats
path: root/libhb/dvd.c
diff options
context:
space:
mode:
authorsaintdev <no-reply@handbrake.fr>2007-03-26 19:38:24 +0000
committersaintdev <no-reply@handbrake.fr>2007-03-26 19:38:24 +0000
commit5b4288a0466445f060e9897ead19a970724dc8c1 (patch)
treeb7db565592eefdc51db8d448fc9cd23d9d4cf73a /libhb/dvd.c
parent03670893ccd2c2c20081cf57797bf925503762ee (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/dvd.c')
-rw-r--r--libhb/dvd.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/libhb/dvd.c b/libhb/dvd.c
index a9bf4309f..9b4ba3fe7 100644
--- a/libhb/dvd.c
+++ b/libhb/dvd.c
@@ -213,6 +213,7 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t )
hb_audio_t * audio, * audio_tmp;
int audio_format, lang_code, audio_control,
position, j;
+ iso639_lang_t * lang;
hb_log( "scan: checking audio %d", i + 1 );
@@ -280,15 +281,19 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t )
continue;
}
+ lang = lang_for_code( vts->vtsi_mat->vts_audio_attr[i].lang_code );
+
snprintf( audio->lang, sizeof( audio->lang ), "%s (%s)",
- lang_for_code( vts->vtsi_mat->vts_audio_attr[i].lang_code ),
+ strlen(lang->native_name) ? lang->native_name : lang->eng_name,
audio->codec == HB_ACODEC_AC3 ? "AC3" : ( audio->codec ==
HB_ACODEC_MPGA ? "MPEG" : "LPCM" ) );
snprintf( audio->lang_simple, sizeof( audio->lang_simple ), "%s",
- lang_for_code( vts->vtsi_mat->vts_audio_attr[i].lang_code ) );
+ strlen(lang->native_name) ? lang->native_name : lang->eng_name );
+ snprintf( audio->iso639_2, sizeof( audio->iso639_2 ), "%s",
+ lang->iso639_2);
- hb_log( "scan: id=%x, lang=%s", audio->id,
- audio->lang );
+ hb_log( "scan: id=%x, lang=%s, 3cc=%s", audio->id,
+ audio->lang, audio->iso639_2 );
hb_list_add( title->list_audio, audio );
}
@@ -309,6 +314,7 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t )
hb_subtitle_t * subtitle;
int spu_control;
int position;
+ iso639_lang_t * lang;
hb_log( "scan: checking subtitle %d", i + 1 );
@@ -340,13 +346,17 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t )
position = ( spu_control >> 24 ) & 0x7F;
}
+ lang = lang_for_code( vts->vtsi_mat->vts_subp_attr[i].lang_code );
+
subtitle = calloc( sizeof( hb_subtitle_t ), 1 );
subtitle->id = ( ( 0x20 + position ) << 8 ) | 0xbd;
snprintf( subtitle->lang, sizeof( subtitle->lang ), "%s",
- lang_for_code( vts->vtsi_mat->vts_subp_attr[i].lang_code ) );
+ strlen(lang->native_name) ? lang->native_name : lang->eng_name);
+ snprintf( subtitle->iso639_2, sizeof( subtitle->iso639_2 ), "%s",
+ lang->iso639_2);
- hb_log( "scan: id=%x, lang=%s", subtitle->id,
- subtitle->lang );
+ hb_log( "scan: id=%x, lang=%s, 3cc=%s", subtitle->id,
+ subtitle->lang, subtitle->iso639_2 );
hb_list_add( title->list_subtitle, subtitle );
}