diff sendstream.php @ 59:f40b6cc4c587

change: viewer & stream
author yoneda <yoneda@recorder.localnet.mda.or.jp>
date Sat, 01 Aug 2009 18:35:11 +0900
parents 8965ef108821
children 01079b81f125
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);
 }