aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-03-15 15:37:29 -0700
committerScott Jackson <daneren2005@gmail.com>2014-03-15 15:37:29 -0700
commitddbe2ce93a6b03d67ba293c023b0ac14dfd240c1 (patch)
tree43729d9ecf637b334cfc73354e2f93574d5a1310
parent7889a30b677b61e7e12a04b2d4eecd2032b708c9 (diff)
downloaddsub-ddbe2ce93a6b03d67ba293c023b0ac14dfd240c1.tar.gz
dsub-ddbe2ce93a6b03d67ba293c023b0ac14dfd240c1.tar.bz2
dsub-ddbe2ce93a6b03d67ba293c023b0ac14dfd240c1.zip
Don't let caught exception run in infinite loop
-rw-r--r--src/github/daneren2005/dsub/util/ShufflePlayBuffer.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/util/ShufflePlayBuffer.java b/src/github/daneren2005/dsub/util/ShufflePlayBuffer.java
index fd7ffb72..c28e24a3 100644
--- a/src/github/daneren2005/dsub/util/ShufflePlayBuffer.java
+++ b/src/github/daneren2005/dsub/util/ShufflePlayBuffer.java
@@ -131,6 +131,12 @@ public class ShufflePlayBuffer {
FileUtil.serialize(context, buffer, CACHE_FILENAME);
}
} catch (Exception x) {
+ // Give it one more try before quitting
+ if(lastCount != -2) {
+ lastCount = -2;
+ } else if(lastCount == -2) {
+ lastCount = 0;
+ }
Log.w(TAG, "Failed to refill shuffle play buffer.", x);
}
}