diff recorder.php @ 165:3d4df1fe4166

merged with upstream
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Thu, 08 Apr 2010 04:22:20 +0900
parents b3095425e613
children 68f6b36e7c01
line wrap: on
line diff
--- a/recorder.php	Fri Apr 02 20:40:55 2010 +0900
+++ b/recorder.php	Thu Apr 08 04:22:20 2010 +0900
@@ -14,6 +14,11 @@
 	define( "RECORDER_CMD", INSTALL_PATH . "/recorder.php" );
 }
 
+$settings = Settings::factory();
+$reserve_id = $argv[1];
+$msgh_r = null;		// 受信用メッセージハンドラ
+$msgh_w = null;		// 送信用メッセージハンドラ
+
 
 // ノンブロッキングメッセージ受信
 
@@ -54,7 +59,7 @@
 function epgrec_childproc( $p )
 {
 	$st = proc_get_status( $p );
-	$cpids = epgrec_childproc( $st['pid'] );
+	$ppid = $st['pid'];
 	
 	// ps を実行する
 	$d = array(
@@ -104,10 +109,6 @@
 
 ////// ここから本編
 
-$settings = Settings::factory();
-$reserve_id = $argv[1];
-$msgh_r = null;		// 受信用メッセージハンドラ
-$msgh_w = null;		// 送信用メッセージハンドラ
 
 // メッセージハンドラを得る
 $ipc_key = ftok( RECORDER_CMD, "R" );
@@ -155,6 +156,7 @@
 	
 	$proch = false;
 	if( ( $proch = epgrec_exec(DO_RECORD) ) !== false ) {
+		reclog("recorder:: 録画ID".$rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."の録画開始" );
 		// 録画完了待ち
 		$rec_cont = true;
 		while( $rec_cont ){
@@ -171,6 +173,7 @@
 						else {
 							epgrec_send_message("success");
 							reclog("recorder:: 録画ID".$rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."の録画が中断された" );
+							$rec_cont = false;
 						}
 						break;
 					
@@ -193,7 +196,6 @@
 	}
 	
 	// 予定より短いようなら終了時間を現在に書き換える
-	
 	if( time() < $endtime ) {
 		$rrec->endtime = toDatetime( time() );
 	}