diff options
author | eddyg <[email protected]> | 2008-10-23 19:23:35 +0000 |
---|---|---|
committer | eddyg <[email protected]> | 2008-10-23 19:23:35 +0000 |
commit | f2910e72629518720d68097bdd0989fda198055d (patch) | |
tree | cee56e2fa811d27327f168f2fcbed51372863f51 /libhb | |
parent | fb4e2f2e0152da33c468edb5a9c921494c1133b2 (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')
-rw-r--r-- | libhb/common.h | 2 | ||||
-rw-r--r-- | libhb/dvd.c | 87 | ||||
-rw-r--r-- | libhb/work.c | 2 |
3 files changed, 86 insertions, 5 deletions
diff --git a/libhb/common.h b/libhb/common.h index c00268da1..c674fd831 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -360,6 +360,7 @@ struct hb_audio_config_s PRIVATE char description[1024]; PRIVATE char simple[1024]; PRIVATE char iso639_2[4]; + PRIVATE uint8_t type; /* normal, visually impared, directors */ } lang; }; @@ -408,6 +409,7 @@ struct hb_subtitle_s int id; char lang[1024]; char iso639_2[4]; + uint8_t type; /* Closed Caption, Childrens, Directors etc */ int hits; /* How many hits/occurrences of this subtitle */ int forced_hits; /* How many forced hits in this subtitle */ 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 ); diff --git a/libhb/work.c b/libhb/work.c index 6caa153e8..00edd050a 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -299,7 +299,7 @@ hb_display_job_info( hb_job_t * job ) if( audio->config.out.name ) hb_log( " + name: %s", audio->config.out.name ); - hb_log( " + decoder: %s (track %d, id %x)", audio->config.lang.description, audio->config.in.track, audio->id ); + hb_log( " + decoder: %s (track %d, id %x)", audio->config.lang.description, audio->config.in.track + 1, audio->id ); if( ( audio->config.in.codec == HB_ACODEC_AC3 ) || ( audio->config.in.codec == HB_ACODEC_DCA) ) { |