mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-16 21:08:01 -04:00
Unset holdbuffer so that when we connect, we reset the shm buffer pointer. cleanup initializers in Image
This commit is contained in:
@@ -114,22 +114,23 @@ Image::Image() :
|
||||
delta8_argb(&std_delta8_argb),
|
||||
delta8_abgr(&std_delta8_abgr),
|
||||
delta8_gray8(&std_delta8_gray8),
|
||||
blend(&std_blend)
|
||||
blend(&std_blend),
|
||||
width(0),
|
||||
linesize(0),
|
||||
height(0),
|
||||
pixels(0),
|
||||
colours(0),
|
||||
padding(0),
|
||||
size(0),
|
||||
subpixelorder(0),
|
||||
allocation(0),
|
||||
buffer(nullptr),
|
||||
buffertype(ZM_BUFTYPE_DONTFREE),
|
||||
holdbuffer(0)
|
||||
{
|
||||
if ( !initialised )
|
||||
if (!initialised)
|
||||
Initialise();
|
||||
width = 0;
|
||||
linesize = 0;
|
||||
height = 0;
|
||||
padding = 0;
|
||||
pixels = 0;
|
||||
colours = 0;
|
||||
subpixelorder = 0;
|
||||
size = 0;
|
||||
allocation = 0;
|
||||
buffer = 0;
|
||||
buffertype = ZM_BUFTYPE_DONTFREE;
|
||||
holdbuffer = 0;
|
||||
// Update blend to fast function determined by Initialise, I'm sure this can be improve.
|
||||
blend = fptr_blend;
|
||||
}
|
||||
|
||||
@@ -158,15 +159,15 @@ Image::Image(int p_width, int p_height, int p_colours, int p_subpixelorder, uint
|
||||
colours(p_colours),
|
||||
padding(p_padding),
|
||||
subpixelorder(p_subpixelorder),
|
||||
buffer(p_buffer) {
|
||||
buffer(p_buffer),
|
||||
holdbuffer(0)
|
||||
{
|
||||
|
||||
if (!initialised)
|
||||
Initialise();
|
||||
pixels = width * height;
|
||||
linesize = p_width * p_colours;
|
||||
size = linesize * height + padding;
|
||||
buffer = nullptr;
|
||||
holdbuffer = 0;
|
||||
if (p_buffer) {
|
||||
allocation = size;
|
||||
buffertype = ZM_BUFTYPE_DONTFREE;
|
||||
@@ -174,7 +175,7 @@ Image::Image(int p_width, int p_height, int p_colours, int p_subpixelorder, uint
|
||||
} else {
|
||||
AllocImgBuffer(size);
|
||||
}
|
||||
if (!subpixelorder and colours>1) {
|
||||
if (!subpixelorder and (colours>1)) {
|
||||
// Default to RGBA when no subpixelorder is specified.
|
||||
subpixelorder = ZM_SUBPIX_ORDER_RGBA;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user