diff options
author | Rodeo <[email protected]> | 2011-08-19 22:25:06 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2011-08-19 22:25:06 +0000 |
commit | 6601e3b53dece956aeedbc3d6e72ed6be0a19b1e (patch) | |
tree | 54bb52d27b645e2db3113bc9cbd163b8651ddbb1 /test | |
parent | 7e77f751d6af40dfae2302d58a0161e7de7e7671 (diff) |
CLI: fix a bug where gain wouldn't be initialized when there were more input audio tracks than the number of gain values specified in the command line.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4189 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'test')
-rw-r--r-- | test/test.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/test.c b/test/test.c index 9f11ef7ae..3f7c04ec3 100644 --- a/test/test.c +++ b/test/test.c @@ -540,6 +540,7 @@ static int HandleEvents( hb_handle_t * h ) int arate = 0; int mixdown = HB_AMIXDOWN_DOLBYPLII; double d_r_c = 0; + double gain = 0; /* Audio argument string parsing variables */ list = hb_get_titles( h ); @@ -1894,7 +1895,6 @@ static int HandleEvents( hb_handle_t * h ) i = 0; if ( audio_gain ) { - double gain; char * token = strtok(audio_gain, ","); if (token == NULL) token = audio_gain; @@ -1915,6 +1915,20 @@ static int HandleEvents( hb_handle_t * h ) token = strtok(NULL, ","); } } + if (i < num_audio_tracks) + { + /* We have fewer inputs than audio tracks, use no gain for the remaining + * tracks. Unless we only have one input, then use the same gain for all + * tracks. + */ + if (i != 1) + gain = 0; + for (; i < num_audio_tracks; i++) + { + audio = hb_list_audio_config_item(job->list_audio, i); + audio->out.gain = gain; + } + } /* Audio Gain */ /* Audio Track Names */ |