Send Text frame when unable to connect to the monitor.
This commit is contained in:
parent
f60d6ff1a3
commit
43e1ac2ad4
|
@ -388,7 +388,6 @@ bool MonitorStream::sendFrame(Image *image, struct timeval *timestamp) {
|
|||
struct timeval frameStartTime;
|
||||
gettimeofday(&frameStartTime, nullptr);
|
||||
|
||||
fputs("--ZoneMinderFrame\r\n", stdout);
|
||||
switch ( type ) {
|
||||
case STREAM_JPEG :
|
||||
send_image->EncodeJpeg(img_buffer, &img_buffer_size);
|
||||
|
@ -452,16 +451,21 @@ void MonitorStream::runStream() {
|
|||
|
||||
openComms();
|
||||
|
||||
if ( type == STREAM_JPEG )
|
||||
fputs("Content-Type: multipart/x-mixed-replace; boundary=" BOUNDARY "\r\n\r\n", stdout);
|
||||
|
||||
if ( !checkInitialised() ) {
|
||||
Error("Not initialized");
|
||||
return;
|
||||
while ( !(loadMonitor(monitor_id) || zm_terminate) ) {
|
||||
sendTextFrame("Not connected");
|
||||
if ( connkey )
|
||||
checkCommandQueue();
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
updateFrameRate(monitor->GetFPS());
|
||||
|
||||
if ( type == STREAM_JPEG )
|
||||
fputs("Content-Type: multipart/x-mixed-replace; boundary=" BOUNDARY "\r\n\r\n", stdout);
|
||||
|
||||
// point to end which is theoretically not a valid value because all indexes are % image_buffer_count
|
||||
unsigned int last_read_index = monitor->image_buffer_count;
|
||||
|
||||
|
|
Loading…
Reference in New Issue