MLV-App
MLV-App copied to clipboard
Win32: caching not working
I tested some functions on Windows with the 32bit version. When enabling caching, the app crashes or the indicator in the statusbar says "idle". :-( No such problems on OSX.
Yeah... that's bad :(, I'll take a look at it.
It always bails out on line 245 of frame_caching.c. There are static castings of float to uint16_t of rgb data taken from the amaze demozaic. I can not understand why it crashes because all seems ok (pix pointer seems in bounds)
In latest revision it is still line 262 of frame_caching.c causing the problem:
...
pix[0] = (uint16_t)MIN(red1d[i], 65536);
...
Yes in win32.
Do we really need the Win32 version? Link
Me not... but it is still the only Win version I can compile and debug... no idea how to compile a 64 bit version :-D The good thing with the 32bit version: you can run it on Wine -> you can run it even on OSX 10.6.8 :-D
OK these are enough reasons :)
I can't tell why... but caching on Win32 version does work now, at least for me. Can someone else try with latest commit? There was changed a lot in terms of debayering... who knows...
Another day, another try, another crash... 😛
Shit ;)
Found out why it crashes:
frame_caching.c line 258
uint16_t * out = video->rgb_raw_frames[cache_frame];
for (uint32_t i = 0; i < pixelsize-10; i++)
{
uint16_t * pix = out + (i*3);
pix[0] = (uint16_t)MIN(red1d[i], 65535);
pix[1] = (uint16_t)MIN(green1d[i], 65535);
pix[2] = (uint16_t)MIN(blue1d[i], 65535);
}
The debugger tells, video->rgb_raw_frames[cache_frame] = 0
, so the memory allocation seems to fail before. But if I check using breakpoints, all seems to be fine. No idea, why it is 0 here...
Problem seems to come from setMlvRawCacheLimitMegaBytes()
, after realloc of video->cache_memory_block
, this one is zero. In the for loop after realloc, video->rgb_raw_frame
is zero too. I tried to exchange realloc with free and malloc, problem persists. All other variables look not bad, only the two buffers are 0.