From: Edward Hervey Date: Wed, 20 Jan 2016 12:42:31 +0000 (+0100) Subject: tools: Fix relative track switching X-Git-Tag: 1.19.3~491^2~1081 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e2c7af46c75f1541a5f056c503305a3573206a6;p=platform%2Fupstream%2Fgstreamer.git tools: Fix relative track switching I have no idea where that "-2" came from, but it was obviously wrong. Just use modulo "total number of streams" to get the proper track id. --- diff --git a/validate/tools/gst-validate.c b/validate/tools/gst-validate.c index 98f4856..8a76937 100644 --- a/validate/tools/gst-validate.c +++ b/validate/tools/gst-validate.c @@ -321,9 +321,7 @@ _execute_switch_track (GstValidateScenario * scenario, } if (relative) { /* We are changing track relatively to current track */ - index = current + index; - if (current >= n) - index = -2; + index = (current + index) % n; } if (!disabling) {