public void setRepeat(int iter) {
        if (iter >= 0) {
            repeat = iter;
        }
    }
Sets the number of times the set of GIF frames should be played. Default is
1; 0 means play indefinitely. Must be invoked before the first image is
added.

@param iter
         int number of iterations.
core/src/main/java/com/bumptech/glide/gifencoder/AnimatedGifEncoder.java