aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-10-03 14:59:16 -0700
committerdaneren2005 <daneren2005@gmail.com>2013-10-03 14:59:16 -0700
commit14c02da411a9f885a226c38c4b26975f604e39d8 (patch)
tree15f7faf6f7652c366471875166c901e323b4340b /src
parenta5bb76f2363f271cc7960e7ed82a78beb6aebc83 (diff)
downloaddsub-14c02da411a9f885a226c38c4b26975f604e39d8.tar.gz
dsub-14c02da411a9f885a226c38c4b26975f604e39d8.tar.bz2
dsub-14c02da411a9f885a226c38c4b26975f604e39d8.zip
Revert last commit
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/service/StreamProxy.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/github/daneren2005/dsub/service/StreamProxy.java b/src/github/daneren2005/dsub/service/StreamProxy.java
index 57235030..3fe1dc17 100644
--- a/src/github/daneren2005/dsub/service/StreamProxy.java
+++ b/src/github/daneren2005/dsub/service/StreamProxy.java
@@ -165,9 +165,6 @@ public class StreamProxy implements Runnable {
return false;
}
- // Make sure to have file lock
- downloadFile.setPlaying(true);
-
// Use either partial or complete if downloading finished while StreamProxy was idle
file = downloadFile.isCompleteFileAvailable() ? downloadFile.getCompleteFile() : downloadFile.getPartialFile();
@@ -204,6 +201,9 @@ public class StreamProxy implements Runnable {
output.write(headers.getBytes());
if(!downloadFile.isWorkDone()) {
+ // Make sure to have file lock
+ downloadFile.setPlaying(true);
+
// Loop as long as there's stuff to send
while (isRunning && !client.isClosed()) {
@@ -240,6 +240,9 @@ public class StreamProxy implements Runnable {
Thread.sleep(1000);
}
}
+
+ // Release file lock, use of stream proxy means nothing else is using it
+ downloadFile.setPlaying(false);
} else {
Log.w(TAG, "Requesting data for completely downloaded file");
}
@@ -258,9 +261,6 @@ public class StreamProxy implements Runnable {
output.close();
}
client.close();
-
- // Release file lock, use of stream proxy means nothing else is using it
- downloadFile.setPlaying(false);
}
catch (IOException e) {
Log.e(TAG, "IOException while cleaning up streaming task:");