Index: /trunk/doc/CHANGES.txt =================================================================== --- /trunk/doc/CHANGES.txt (リビジョン 42) +++ /trunk/doc/CHANGES.txt (リビジョン 43) @@ -4,4 +4,8 @@ viewepg.php:  現在時刻の番組が正しく表示出来てない場合があるのを修正。 + +recwrap.pl: +tvrecording.pl: + デバイスビジーで録画デバイスをつかめなかった場合のリカバリ機構搭載(まだ検証が甘い) 07.1.19 Index: /trunk/install/perl/tvrecording.pl =================================================================== --- /trunk/install/perl/tvrecording.pl (リビジョン 29) +++ /trunk/install/perl/tvrecording.pl (リビジョン 43) @@ -268,8 +268,11 @@ $reclengthsec = $reclengthsec + (60 - $startupsleep) + 1; # -&writelog("tvrecording: DEBUG SLEEP $startupsleeptime:$intval:$startupsleep:$reclengthsec"); - -sleep ( $startupsleep); - +if ( $ARGV[2] ne "N"){ + &writelog("tvrecording: DEBUG SLEEP $startupsleeptime:$intval:$startupsleep:$reclengthsec"); + sleep ( $startupsleep); +}else{ + &writelog("tvrecording: DEBUG RAPID START"); + +} if ($recunits > 1){ my $deviceno = $recunits - 1;#3枚差しのとき/dev/video2から使う @@ -321,6 +324,8 @@ #二重録りなど既に同名ファイルがあったら中断 if ( -e "$outputfile" ){ -&writelog("tvrecording :ABORT :recfile $outputfile exist."); -exit 1; + if ( -s "$outputfile" ){ + &writelog("tvrecording :ABORT :recfile $outputfile exist."); + exit 1; + } } Index: /trunk/install/perl/recwrap.pl =================================================================== --- /trunk/install/perl/recwrap.pl (リビジョン 8) +++ /trunk/install/perl/recwrap.pl (リビジョン 43) @@ -75,4 +75,6 @@ #録画 #system("$toolpath/perl/tvrecording.pl $recch $reclength 0 $outputfile $bitrate $tid $countno"); +$starttime = (`date +%s`); + $oserr = system("$toolpath/perl/tvrecording.pl $recch $reclength 0 $outputfilename $bitrate $tid $countno"); $oserr = $oserr / 256; @@ -80,7 +82,24 @@ &writelog("recwrap ABORT recfile exist. [$outputfilename] $recch $reclength 0 0 $bitrate $tid $countno $pid"); exit; -}else{ +} +#デバイスビジーで即死してないか検出 +$now = (`date +%s`); + if ($now < $starttime + 100){ #録画プロセス起動してから100秒以内に戻ってきてたら + while($now < $starttime + 100){ + &writelog("recwrap retry recording $now $starttime"); +$starttime = (`date +%s`); +$oserr = system("$toolpath/perl/tvrecording.pl $recch $reclength 0 $outputfilename $bitrate $tid $countno"); +$now = (`date +%s`); +$oserr = $oserr / 256; + if ($oserr == 1){ + &writelog("recwrap ABORT recfile exist. in resume process.[$outputfilename] $recch $reclength 0 0 $bitrate $tid $countno $pid"); + exit; + }# if + }# while + } # if + + &writelog("recwrap RECEND [$outputfilename] $recch $reclength 0 0 $bitrate $tid $countno $pid"); -} + #DB初期化 my $data_source = sprintf("dbi:%s:dbname=%s;host=%s;port=%d",