diff options
-rw-r--r-- | src/github/daneren2005/dsub/service/StreamProxy.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/github/daneren2005/dsub/service/StreamProxy.java b/src/github/daneren2005/dsub/service/StreamProxy.java index 24c1b201..76d8382c 100644 --- a/src/github/daneren2005/dsub/service/StreamProxy.java +++ b/src/github/daneren2005/dsub/service/StreamProxy.java @@ -183,6 +183,9 @@ public class StreamProxy implements Runnable { output.write(headers.getBytes());
if(!downloadFile.isWorkDone()) {
+ // Make sure have file lock
+ downloadFile.setPlaying(true);
+
// Loop as long as there's stuff to send
while (isRunning && !client.isClosed()) {
@@ -220,6 +223,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");
}
|