summaryrefslogtreecommitdiffstats
path: root/test/test.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-05-06 20:53:32 +0000
committerjstebbins <[email protected]>2015-05-06 20:53:32 +0000
commit9ef14487e91592b945c937dbff540a8a0a15b64b (patch)
treee9104c199809d9c1deb3b7bcdc42bfeb4bcfed37 /test/test.c
parent852787d345b67aa8a88fdb4ecc953868a4e94e45 (diff)
cli: fix off-by-one audio track selection
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7160 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'test/test.c')
-rw-r--r--test/test.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/test.c b/test/test.c
index d489ffd08..b40c6478c 100644
--- a/test/test.c
+++ b/test/test.c
@@ -3570,14 +3570,14 @@ static int add_srt(hb_value_array_t *list, int track, int *one_burned)
static int add_audio(hb_value_array_t *list, hb_title_t *title, int track)
{
// Check that the track exists
- if (hb_list_item(title->list_audio, track) == NULL)
+ if (hb_list_item(title->list_audio, track-1) == NULL)
{
fprintf(stderr, "Warning: Could not find audio track %d, skipped\n",
- track + 1);
+ track);
return -1;
}
hb_dict_t *audio_dict = hb_dict_init();
- hb_dict_set(audio_dict, "Track", hb_value_int(track));
+ hb_dict_set(audio_dict, "Track", hb_value_int(track-1));
hb_value_array_append(list, audio_dict);
return 0;