summaryrefslogtreecommitdiffstats
path: root/libhb/dvd.c
diff options
context:
space:
mode:
authorRodeo <[email protected]>2012-05-03 17:45:00 +0000
committerRodeo <[email protected]>2012-05-03 17:45:00 +0000
commita1161011aae76d215675fc354c42a0fac27d1476 (patch)
treec09d03aa827c78dae3dc0d45749dbd674094c81e /libhb/dvd.c
parent4aeadc9bc63d200d6c0b709eba7e25c4f3afe24c (diff)
audio->config.lang.description: code cleanup.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4637 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/dvd.c')
-rw-r--r--libhb/dvd.c130
1 files changed, 58 insertions, 72 deletions
diff --git a/libhb/dvd.c b/libhb/dvd.c
index f4260d5fc..43af43a05 100644
--- a/libhb/dvd.c
+++ b/libhb/dvd.c
@@ -173,6 +173,7 @@ static hb_title_t * hb_dvdread_title_scan( hb_dvd_t * e, int t, uint64_t min_dur
uint64_t duration;
float duration_correction;
unsigned char unused[1024];
+ const char * codec_name;
hb_log( "scan: scanning title %d", t );
@@ -324,11 +325,9 @@ static hb_title_t * hb_dvdread_title_scan( hb_dvd_t * e, int t, uint64_t min_dur
/* Detect languages */
for( i = 0; i < vts->vtsi_mat->nr_of_vts_audio_streams; i++ )
{
+ int audio_format, lang_code, lang_extension, audio_control, position, j;
hb_audio_t * audio, * audio_tmp;
- 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 );
@@ -354,27 +353,32 @@ static hb_title_t * hb_dvdread_title_scan( hb_dvd_t * e, int t, uint64_t min_dur
case 0x00:
audio->id = ( ( 0x80 + position ) << 8 ) | 0xbd;
audio->config.in.codec = HB_ACODEC_AC3;
+ codec_name = "AC3";
break;
case 0x02:
case 0x03:
audio->id = 0xc0 + position;
audio->config.in.codec = HB_ACODEC_FFMPEG;
+ codec_name = "MPEG";
break;
case 0x04:
audio->id = ( ( 0xa0 + position ) << 8 ) | 0xbd;
audio->config.in.codec = HB_ACODEC_LPCM;
+ codec_name = "LPCM";
break;
case 0x06:
audio->id = ( ( 0x88 + position ) << 8 ) | 0xbd;
audio->config.in.codec = HB_ACODEC_DCA;
+ codec_name = "DTS";
break;
default:
audio->id = 0;
audio->config.in.codec = 0;
+ codec_name = "Unknown";
hb_log( "scan: unknown audio codec (%x)",
audio_format );
break;
@@ -402,36 +406,32 @@ static hb_title_t * hb_dvdread_title_scan( hb_dvd_t * e, int t, uint64_t min_dur
continue;
}
- audio->config.lang.type = lang_extension;
-
lang = lang_for_code( lang_code );
- snprintf( audio->config.lang.description, sizeof( audio->config.lang.description ), "%s (%s)",
- strlen(lang->native_name) ? lang->native_name : lang->eng_name,
- audio->config.in.codec == HB_ACODEC_AC3 ? "AC3" : ( audio->config.in.codec ==
- HB_ACODEC_DCA ? "DTS" : ( audio->config.in.codec ==
- HB_ACODEC_FFMPEG ? "MPEG" : "LPCM" ) ) );
- snprintf( audio->config.lang.simple, sizeof( audio->config.lang.simple ), "%s",
- strlen(lang->native_name) ? lang->native_name : lang->eng_name );
- snprintf( audio->config.lang.iso639_2, sizeof( audio->config.lang.iso639_2 ), "%s",
- lang->iso639_2);
+ audio->config.lang.type = lang_extension;
+
+ snprintf( audio->config.lang.simple,
+ sizeof( audio->config.lang.simple ), "%s",
+ strlen( lang->native_name ) ? lang->native_name : lang->eng_name );
+ snprintf( audio->config.lang.iso639_2,
+ sizeof( audio->config.lang.iso639_2 ), "%s", lang->iso639_2 );
+ snprintf( audio->config.lang.description,
+ sizeof( audio->config.lang.description ), "%s (%s)",
+ audio->config.lang.simple, codec_name );
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;
+ 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=0x%x, lang=%s, 3cc=%s ext=%i", audio->id,
@@ -508,52 +508,38 @@ static hb_title_t * hb_dvdread_title_scan( hb_dvd_t * e, int t, uint64_t min_dur
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;
+ case 2:
+ strcat( subtitle->lang, " (Caption with bigger size character)" );
+ break;
+ case 3:
+ strcat( subtitle->lang, " (Caption for Children)" );
+ 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 9:
+ strcat( subtitle->lang, " (Forced Caption)" );
+ 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=0x%x, lang=%s, 3cc=%s", subtitle->id,
- subtitle->lang, subtitle->iso639_2 );
+ hb_log( "scan: id=0x%x, lang=%s, 3cc=%s ext=%i", subtitle->id,
+ subtitle->lang, subtitle->iso639_2, lang_extension );
hb_list_add( title->list_subtitle, subtitle );
}