Fix crash due to deplicated join. Don't output BOUNDARY unless image loading suceeds
parent
087be40337
commit
788bb603e1
|
@ -717,9 +717,8 @@ bool EventStream::sendFrame(Microseconds delta_us) {
|
||||||
} else {
|
} else {
|
||||||
bool send_raw = (type == STREAM_JPEG) && ((scale >= ZM_SCALE_BASE) && (zoom == ZM_SCALE_BASE)) && !filepath.empty();
|
bool send_raw = (type == STREAM_JPEG) && ((scale >= ZM_SCALE_BASE) && (zoom == ZM_SCALE_BASE)) && !filepath.empty();
|
||||||
|
|
||||||
fprintf(stdout, "--" BOUNDARY "\r\n");
|
|
||||||
|
|
||||||
if (send_raw) {
|
if (send_raw) {
|
||||||
|
fprintf(stdout, "--" BOUNDARY "\r\n");
|
||||||
if (!send_file(filepath)) {
|
if (!send_file(filepath)) {
|
||||||
Error("Can't send %s: %s", filepath.c_str(), strerror(errno));
|
Error("Can't send %s: %s", filepath.c_str(), strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
|
@ -784,6 +783,7 @@ bool EventStream::sendFrame(Microseconds delta_us) {
|
||||||
int img_buffer_size = 0;
|
int img_buffer_size = 0;
|
||||||
uint8_t *img_buffer = temp_img_buffer;
|
uint8_t *img_buffer = temp_img_buffer;
|
||||||
|
|
||||||
|
fprintf(stdout, "--" BOUNDARY "\r\n");
|
||||||
switch ( type ) {
|
switch ( type ) {
|
||||||
case STREAM_JPEG :
|
case STREAM_JPEG :
|
||||||
send_image->EncodeJpeg(img_buffer, &img_buffer_size);
|
send_image->EncodeJpeg(img_buffer, &img_buffer_size);
|
||||||
|
@ -1074,7 +1074,6 @@ void EventStream::runStream() {
|
||||||
} else {
|
} else {
|
||||||
Debug(1, "command_processor is not joinable");
|
Debug(1, "command_processor is not joinable");
|
||||||
}
|
}
|
||||||
command_processor.join();
|
|
||||||
}
|
}
|
||||||
} // end void EventStream::runStream()
|
} // end void EventStream::runStream()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue