comparison 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
comparison
equal deleted inserted replaced
58:80dc62c94185 59:f40b6cc4c587
33 ob_clean(); 33 ob_clean();
34 flush(); 34 flush();
35 35
36 $fp = @fopen( INSTALL_PATH.$settings->spool."/".$rrec->path, "r" ); 36 $fp = @fopen( INSTALL_PATH.$settings->spool."/".$rrec->path, "r" );
37 if( $fp !== false ) { 37 if( $fp !== false ) {
38 ob_start(null,4096);
39 $status = array();
40 do { 38 do {
41 echo fread( $fp, 4096 ); 39 $start = microtime(true);
42 if( feof( $fp ) ) break; 40 if( feof( $fp ) ) break;
43 41
44 $status = ob_get_status(); 42 echo fread( $fp, 6292 );
43
44 usleep( 2000 - (int)((microtime(true) - $start) * 1000) );
45 } 45 }
46 while( $status['status'] != PHP_OUTPUT_HANDLER_END ); 46 while( ! connection_aborted() );
47 } 47 }
48 fclose($fp); 48 fclose($fp);
49 } 49 }
50 catch(exception $e ) { 50 catch(exception $e ) {
51 exit( $e->getMessage() ); 51 exit( $e->getMessage() );