Code: Select all
Index: test/test.c
===================================================================
--- test/test.c (revision 2048)
+++ test/test.c (working copy)
@@ -56,6 +56,7 @@
static char * abitrates = NULL;
static char * acodecs = NULL;
static char * anames = NULL;
+static char * alangs = NULL;
static int default_acodec = HB_ACODEC_FAAC;
static int default_arate = 48000;
static int default_abitrate = 160;
@@ -285,6 +286,7 @@
if( abitrates ) free( abitrates );
if( acodecs ) free( acodecs );
if( anames ) free( anames );
+ if( alangs ) free( alangs );
if (native_language ) free (native_language );
if( x264opts ) free (x264opts );
if( x264opts2 ) free (x264opts2 );
@@ -1591,6 +1593,29 @@
token = strtok(NULL, ",");
}
}
+ i = 0;
+ if ( alangs )
+ {
+ char *token = strtok(alangs, ",");
+ if (token == NULL)
+ token = alangs;
+ while ( token != NULL )
+ {
+ audio = hb_list_audio_config_item(job->list_audio, i);
+ if (audio != NULL )
+ {
+ snprintf(audio->lang.iso639_2,
+ sizeof(audio->lang.iso639_2), "%s", token);
+ if( (++i) >= num_audio_tracks )
+ break; /* We have more languages than audio tracks, oops */
+ }
+ else
+ {
+ fprintf(stderr, "Ignoring alang '%s', no audio track\n", token);
+ }
+ token = strtok(NULL, ",");
+ }
+ }
if( i < num_audio_tracks && i == 1 )
{
/* We have exactly one name and more than one audio track. Use the same
@@ -1951,6 +1976,8 @@
" Separated by commas for more than one audio track.\n"
" -A, --aname <string> Audio track name(s),\n"
" Separated by commas for more than one audio track.\n"
+ " -G, --alang <string> Audio track language(s),\n"
+ " Separated by commas for more than one audio track.\n"
"\n"
"### Picture Settings---------------------------------------------------------\n\n"
@@ -2140,6 +2167,7 @@
{ "preset-list", no_argument, NULL, 'z' },
{ "aname", required_argument, NULL, 'A' },
+ { "alang", required_argument, NULL, 'G' },
{ "color-matrix",required_argument, NULL, 'M' },
{ "previews", required_argument, NULL, PREVIEWS },
@@ -2487,6 +2515,12 @@
anames = strdup( optarg );
}
break;
+ case 'G':
+ if( optarg != NULL )
+ {
+ alangs = strdup( optarg );
+ }
+ break;
case PREVIEWS:
sscanf( optarg, "%i:%i", &preview_count, &store_previews );
break;