const void *VideoSourceImages::getFrame(VDPosition frameNum) { uint32 lBytes; const void *pFrame = NULL; if (mCachedFrame == frameNum) return mpFrameBuffer; if (!read(frameNum, 1, NULL, 0x7FFFFFFF, &lBytes, NULL) && lBytes) { char *pBuffer = new char[lBytes]; try { uint32 lReadBytes; read(frameNum, 1, pBuffer, lBytes, &lReadBytes, NULL); pFrame = streamGetFrame(pBuffer, lReadBytes, FALSE, frameNum, frameNum); } catch(MyError e) { delete[] pBuffer; throw; } delete[] pBuffer; } return pFrame; }
const void *VDVideoSourceFLM::getFrame(VDPosition frameNum) { uint32 lBytes; const void *pFrame = NULL; if (mCachedFrame == frameNum) return mpFrameBuffer; if (!read(frameNum, 1, NULL, 0x7FFFFFFF, &lBytes, NULL) && lBytes) { vdblock<char> buffer(lBytes); uint32 lReadBytes; read(frameNum, 1, buffer.data(), lBytes, &lReadBytes, NULL); pFrame = streamGetFrame(buffer.data(), lReadBytes, FALSE, frameNum, frameNum); } return pFrame; }