summaryrefslogtreecommitdiffstats
path: root/libhb/dvd.c
diff options
context:
space:
mode:
authoreddyg <[email protected]>2008-10-23 19:23:35 +0000
committereddyg <[email protected]>2008-10-23 19:23:35 +0000
commitf2910e72629518720d68097bdd0989fda198055d (patch)
treecee56e2fa811d27327f168f2fcbed51372863f51 /libhb/dvd.c
parentfb4e2f2e0152da33c468edb5a9c921494c1133b2 (diff)
Added support for extracting the audio and subtitle types and adding those to the audio and subtitle names, e.g. Director's Commentary.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1863 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/dvd.c')
-rw-r--r--libhb/dvd.c87
1 files changed, 83 insertions, 4 deletions
diff --git a/libhb/dvd.c b/libhb/dvd.c
index c21a24589..85fe47e8d 100644
--- a/libhb/dvd.c
+++ b/libhb/dvd.c
@@ -165,6 +165,11 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t )
goto fail;
}
+ if( global_verbosity_level == 3 )
+ {
+ ifoPrint( d->reader, title->vts );
+ }
+
/* Position of the title in the VTS */
title->ttn = d->vmg->tt_srpt->title[t-1].vts_ttn;
@@ -237,6 +242,7 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t )
int audio_format, lang_code, audio_control,
position, j;
iso639_lang_t * lang;
+ int lang_extension = 0;
hb_log( "scan: checking audio %d", i + 1 );
@@ -244,6 +250,7 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t )
audio_format = vts->vtsi_mat->vts_audio_attr[i].audio_format;
lang_code = vts->vtsi_mat->vts_audio_attr[i].lang_code;
+ lang_extension = vts->vtsi_mat->vts_audio_attr[i].code_extension;
audio_control =
vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->audio_control[i];
@@ -309,6 +316,8 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t )
continue;
}
+ audio->config.lang.type = lang_extension;
+
lang = lang_for_code( vts->vtsi_mat->vts_audio_attr[i].lang_code );
snprintf( audio->config.lang.description, sizeof( audio->config.lang.description ), "%s (%s)",
@@ -321,8 +330,27 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t )
snprintf( audio->config.lang.iso639_2, sizeof( audio->config.lang.iso639_2 ), "%s",
lang->iso639_2);
- hb_log( "scan: id=%x, lang=%s, 3cc=%s", audio->id,
- audio->config.lang.description, audio->config.lang.iso639_2 );
+ switch( lang_extension )
+ {
+ case 0:
+ case 1:
+ break;
+ case 2:
+ strcat( audio->config.lang.description, " (Visually Impaired)" );
+ break;
+ case 3:
+ strcat( audio->config.lang.description, " (Director's Commentary 1)" );
+ break;
+ case 4:
+ strcat( audio->config.lang.description, " (Director's Commentary 2)" );
+ break;
+ default:
+ break;
+ }
+
+ hb_log( "scan: id=%x, lang=%s, 3cc=%s ext=%i", audio->id,
+ audio->config.lang.description, audio->config.lang.iso639_2,
+ lang_extension );
audio->config.in.track = i;
hb_list_add( title->list_audio, audio );
@@ -345,6 +373,7 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t )
int spu_control;
int position;
iso639_lang_t * lang;
+ int lang_extension = 0;
hb_log( "scan: checking subtitle %d", i + 1 );
@@ -376,14 +405,64 @@ hb_title_t * hb_dvd_title_scan( hb_dvd_t * d, int t )
position = ( spu_control >> 24 ) & 0x7F;
}
+ lang_extension = vts->vtsi_mat->vts_subp_attr[i].code_extension;
+
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",
strlen(lang->native_name) ? lang->native_name : lang->eng_name);
- snprintf( subtitle->iso639_2, sizeof( subtitle->iso639_2 ), "%s",
- lang->iso639_2);
+ snprintf( subtitle->iso639_2, sizeof( subtitle->iso639_2 ), "%s",
+ lang->iso639_2);
+
+ subtitle->type = lang_extension;
+
+ switch( lang_extension )
+ {
+ case 0:
+ break;
+ case 1:
+ break;
+ case 2:
+ strcat( subtitle->lang, " (Caption with bigger size character)");
+ break;
+ case 3:
+ strcat( subtitle->lang, " (Caption for Children)");
+ break;
+ case 4:
+ break;
+ case 5:
+ strcat( subtitle->lang, " (Closed Caption)");
+ break;
+ case 6:
+ strcat( subtitle->lang, " (Closed Caption with bigger size character)");
+ break;
+ case 7:
+ strcat( subtitle->lang, " (Closed Caption for Children)");
+ break;
+ case 8:
+ break;
+ case 9:
+ strcat( subtitle->lang, " (Forced Caption)");
+ break;
+ case 10:
+ break;
+ case 11:
+ break;
+ case 12:
+ break;
+ case 13:
+ strcat( subtitle->lang, " (Director's Commentary)");
+ break;
+ case 14:
+ strcat( subtitle->lang, " (Director's Commentary with bigger size character)");
+ break;
+ case 15:
+ strcat( subtitle->lang, " (Director's Commentary for Children)");
+ default:
+ break;
+ }
hb_log( "scan: id=%x, lang=%s, 3cc=%s", subtitle->id,
subtitle->lang, subtitle->iso639_2 );