2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-01 01:09:47 +00:00

FRAMEBUFFER performance optimization

don't close the pipe to fbvs immediately as this waits for the
child process to finish


git-svn-id: https://svn.fhem.de/fhem/trunk@6015 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
kaihs 2014-05-30 18:36:06 +00:00
parent 8f6a02ccd0
commit 303330138e

View File

@ -126,6 +126,11 @@ sub FRAMEBUFFER_updateDisplay($) {
my ($hash) = @_;
my $name = $hash->{NAME};
my $fbv = '/usr/local/bin/fbvs';
my $fd = $hash->{fd};
if (defined $fd) {
close $fd;
}
if (-x $fbv) {
if (defined $hash->{debugFile}) {
@ -138,10 +143,12 @@ sub FRAMEBUFFER_updateDisplay($) {
}
if (FRAMEBUFFER_readLayout($hash)) {
open(FBV, "|".$fbv . ' -d '. $hash->{fhem}{fb_device});
binmode FBV;
print FBV FRAMEBUFFER_returnPNG($name);
close FBV;
open($fd, "|".$fbv . ' -d '. $hash->{fhem}{fb_device});
binmode $fd;
print $fd FRAMEBUFFER_returnPNG($name);
# don't close the file immediately, as this will wait
# for the fbv process to terminate which may take some time
#close FBV;
}
} else {
Log3 $name, 1, "$fbv doesn't exist or isn't executable, please install it";