changeset 59:f40b6cc4c587

change: viewer & stream
author yoneda <yoneda@recorder.localnet.mda.or.jp>
date Sat, 01 Aug 2009 18:35:11 +0900
parents 80dc62c94185
children 01079b81f125
files sendstream.php viewer.php
diffstat 2 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/sendstream.php	Wed Jul 29 16:53:56 2009 +0900
+++ b/sendstream.php	Sat Aug 01 18:35:11 2009 +0900
@@ -35,15 +35,15 @@
 	
 	$fp = @fopen( INSTALL_PATH.$settings->spool."/".$rrec->path, "r" );
 	if( $fp !== false ) {
-		ob_start(null,4096);
-		$status = array();
 		do {
-			echo fread( $fp, 4096 );
+			$start = microtime(true);
 			if( feof( $fp ) ) break;
 			
-			$status = ob_get_status();
+			echo fread( $fp, 6292 );
+			
+			usleep( 2000 - (int)((microtime(true) - $start) * 1000)  );
 		}
-		while( $status['status'] != PHP_OUTPUT_HANDLER_END );
+		while( ! connection_aborted() );
 	}
 	fclose($fp);
 }
--- a/viewer.php	Wed Jul 29 16:53:56 2009 +0900
+++ b/viewer.php	Sat Aug 01 18:35:11 2009 +0900
@@ -37,7 +37,7 @@
 	echo "<ASX version = \"3.0\">";
 	echo "<PARAM NAME = \"Encoding\" VALUE = \"UTF-8\" />";
 	echo "<ENTRY>";
-	echo "<REF HREF=\"".$settings->install_url."/sendstream.php?reserve_id=".$rrec->id ."\" />";
+	if( ! $rrec->complete ) echo "<REF HREF=\"".$settings->install_url."/sendstream.php?reserve_id=".$rrec->id ."\" />";
 	echo "<REF HREF=\"".$settings->install_url.$settings->spool."/".$rrec->path ."\" />";
 	echo "<TITLE>".$title."</TITLE>";
 	echo "<ABSTRACT>".$abstract."</ABSTRACT>";
@@ -49,4 +49,4 @@
 catch(exception $e ) {
 	exit( $e->getMessage() );
 }
-?>
+?>
\ No newline at end of file