[Red5commits] [1270] Assume "record" mode when resource not exists in "append" mode. (#108)

sgong luke at codegent.com
Thu Aug 17 18:50:06 EDT 2006


Assume "record" mode when resource not exists in "append" mode. (#108)


Timestamp: 08/18/06 08:41:07 (less than one hour ago) 
Change: 1270 
Author: sgong

Files (see diff or trac for details): 
java/server/trunk/src/org/red5/server/stream/ClientBroadcastStream.java


Trac: http://mirror1.cvsdude.com/trac/osflash/red5/changeset/1270

Index: /java/server/trunk/src/org/red5/server/stream/ClientBroadcastStream.java
===================================================================
--- /java/server/trunk/src/org/red5/server/stream/ClientBroadcastStream.java (revision 1260)
+++ /java/server/trunk/src/org/red5/server/stream/ClientBroadcastStream.java (revision 1270)
@@ -120,6 +120,19 @@
 			String filename = generator.generateFilename(scope, name, ".flv");
 			Resource res = scope.getResource(filename);
-			if (!isAppend && res.exists()) 
-				res.getFile().delete();
+			if (!isAppend) {
+				if (res.exists()) {
+					// Per livedoc of FCS/FMS:
+					// When "live" or "record" is used,
+					// any previously recorded stream with the same stream URI is deleted.
+					res.getFile().delete();
+				}
+			} else {
+				if (!res.exists()) {
+					// Per livedoc of FCS/FMS:
+					// If a recorded stream at the same URI does not already exist,
+					// "append" creates the stream as though "record" was passed.
+					isAppend = false;
+				}
+			}
 			
 			if (!res.exists()) {


Note:
Diffs are chopped if more than 25k.
This is to get past the limit on the mailing list.



More information about the Red5commits mailing list