Capture can reasonably return -1 for EOF.
This commit is contained in:
parent
c9b4f14171
commit
fe1e17d097
|
@ -2383,7 +2383,7 @@ int Monitor::Capture() {
|
|||
}
|
||||
|
||||
if ( captureResult < 0 ) {
|
||||
Warning("Return from Capture (%d), signal loss", captureResult);
|
||||
Info("Return from Capture (%d), signal loss", captureResult);
|
||||
// Unable to capture image for temporary reason
|
||||
// Fake a signal loss image
|
||||
Rgb signalcolor;
|
||||
|
|
|
@ -300,19 +300,22 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
if ( next_delays[i] <= min_delay || next_delays[i] <= 0 ) {
|
||||
if ( monitors[i]->PreCapture() < 0 ) {
|
||||
Error("Failed to pre-capture monitor %d %d (%d/%d)", monitors[i]->Id(), monitors[i]->Name(), i+1, n_monitors);
|
||||
Error("Failed to pre-capture monitor %d %d (%d/%d)",
|
||||
monitors[i]->Id(), monitors[i]->Name(), i+1, n_monitors);
|
||||
monitors[i]->Close();
|
||||
result = -1;
|
||||
break;
|
||||
}
|
||||
if ( monitors[i]->Capture() < 0 ) {
|
||||
Error("Failed to capture image from monitor %d %s (%d/%d)", monitors[i]->Id(), monitors[i]->Name(), i+1, n_monitors);
|
||||
Info("Failed to capture image from monitor %d %s (%d/%d)",
|
||||
monitors[i]->Id(), monitors[i]->Name(), i+1, n_monitors);
|
||||
monitors[i]->Close();
|
||||
result = -1;
|
||||
break;
|
||||
}
|
||||
if ( monitors[i]->PostCapture() < 0 ) {
|
||||
Error("Failed to post-capture monitor %d %s (%d/%d)", monitors[i]->Id(), monitors[i]->Name(), i+1, n_monitors);
|
||||
Error("Failed to post-capture monitor %d %s (%d/%d)",
|
||||
monitors[i]->Id(), monitors[i]->Name(), i+1, n_monitors);
|
||||
monitors[i]->Close();
|
||||
result = -1;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue