X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;ds=sidebyside;f=cinelerra-5.1%2Fguicast%2Fvframe.C;h=eaa1f078cb826c063f27880296de0b507d4dfb90;hb=667ff598ae2a94f48c7056aee1d77d7cde39066b;hp=1cfeb58b8c988b8daae95244f259f09618dd6088;hpb=ad2996ab94e6e12c9c14a5b9f14792f76111dff7;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/guicast/vframe.C b/cinelerra-5.1/guicast/vframe.C index 1cfeb58b..eaa1f078 100644 --- a/cinelerra-5.1/guicast/vframe.C +++ b/cinelerra-5.1/guicast/vframe.C @@ -131,6 +131,7 @@ VFrame::VFrame(VFrame &frame) { reset_parameters(1); params = new BC_Hash; + use_shm = frame.use_shm; allocate_data(0, -1, 0, 0, 0, frame.w, frame.h, frame.color_model, frame.bytes_per_line); copy_from(&frame); @@ -504,7 +505,8 @@ int VFrame::allocate_data(unsigned char *data, int shmid, this->data = 0; int size = calculate_data_size(this->w, this->h, this->bytes_per_line, this->color_model); - if(BC_WindowBase::get_resources()->use_vframe_shm() && use_shm) { + if( use_shm && size >= SHM_MIN_SIZE && + BC_WindowBase::get_resources()->use_vframe_shm() ) { this->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0777); if( this->shmid >= 0 ) { this->data = (unsigned char*)shmat(this->shmid, NULL, 0); @@ -520,7 +522,7 @@ int VFrame::allocate_data(unsigned char *data, int shmid, } } // Have to use malloc for libpng - if( !data ) { + if( !this->data ) { this->data = (unsigned char *)malloc(size); this->shmid = -1; }