Fixed memory handling in dummy provider.

Originally committed to SVN as r974.
This commit is contained in:
Rodrigo Braz Monteiro 2007-04-01 23:13:29 +00:00
parent 1d03da6844
commit bef344645b
1 changed files with 10 additions and 8 deletions

View File

@ -44,6 +44,7 @@
class DummyVideoProvider : public VideoProvider {
private:
int lastFrame;
AegiVideoFrame frame;
protected:
const AegiVideoFrame DoGetFrame(int n);
@ -74,6 +75,15 @@ public:
// Constructor
DummyVideoProvider::DummyVideoProvider(wxString filename, double fps) {
lastFrame = -1;
frame = AegiVideoFrame(640,480,FORMAT_RGB32);
unsigned char *dst = frame.data[0];
for (int i=frame.pitch[0]*frame.h/frame.GetBpp();--i>=0;) {
*dst++ = 254;
*dst++ = 163;
*dst++ = 47;
*dst++ = 0;
}
}
@ -87,14 +97,6 @@ DummyVideoProvider::~DummyVideoProvider() {
// Get frame
const AegiVideoFrame DummyVideoProvider::DoGetFrame(int n) {
lastFrame = n;
AegiVideoFrame frame(640,480,FORMAT_RGB32);
unsigned char *dst = frame.data[0];
for (int i=frame.pitch[0]*frame.h/frame.GetBpp();--i>=0;) {
*dst++ = 254;
*dst++ = 163;
*dst++ = 47;
*dst++ = 0;
}
return frame;
}