mirror of
https://github.com/XProger/OpenLara.git
synced 2025-07-31 02:10:35 +02:00
#129 add IMA audio support for TR3 FMVs
This commit is contained in:
178
src/sound.h
178
src/sound.h
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#define DECODE_VAG
|
#define DECODE_VAG
|
||||||
#define DECODE_ADPCM
|
#define DECODE_ADPCM
|
||||||
|
#define DECODE_IMA
|
||||||
|
|
||||||
#define DECODE_OGG
|
#define DECODE_OGG
|
||||||
|
|
||||||
@@ -139,19 +140,62 @@ namespace Sound {
|
|||||||
|
|
||||||
struct Decoder {
|
struct Decoder {
|
||||||
Stream *stream;
|
Stream *stream;
|
||||||
int channels, offset;
|
int channels, freq, offset;
|
||||||
|
Frame prevFrame;
|
||||||
|
|
||||||
|
Decoder(Stream *stream, int channels, int freq) : stream(stream), channels(channels), freq(freq), offset(stream->pos) {
|
||||||
|
memset(&prevFrame, 0, sizeof(prevFrame));
|
||||||
|
}
|
||||||
|
|
||||||
Decoder(Stream *stream, int channels) : stream(stream), channels(channels), offset(stream->pos) {}
|
|
||||||
virtual ~Decoder() { delete stream; }
|
virtual ~Decoder() { delete stream; }
|
||||||
virtual int decode(Frame *frames, int count) { return 0; }
|
virtual int decode(Frame *frames, int count) { return 0; }
|
||||||
virtual void replay() { stream->seek(offset - stream->pos); }
|
virtual void replay() { stream->seek(offset - stream->pos); }
|
||||||
|
|
||||||
|
int resample(Sound::Frame *frames, Sound::Frame &frame) {
|
||||||
|
if (freq == 44100) {
|
||||||
|
frames[0] = frame;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int dL = int(frame.L) - int(prevFrame.L);
|
||||||
|
int dR = int(frame.R) - int(prevFrame.R);
|
||||||
|
switch (freq) {
|
||||||
|
case 11025 :
|
||||||
|
if (channels == 2) {
|
||||||
|
frames[0].L = prevFrame.L + dL / 4; // 0.25 L
|
||||||
|
frames[0].R = prevFrame.R + dR / 4; // 0.25 R
|
||||||
|
frames[1].L = prevFrame.L + dL / 2; // 0.50 L
|
||||||
|
frames[1].R = prevFrame.R + dR / 2; // 0.50 R
|
||||||
|
frames[2].L = prevFrame.L + dL * 3 / 4; // 0.75 L
|
||||||
|
frames[2].R = prevFrame.R + dR * 3 / 4; // 0.75 R
|
||||||
|
} else {
|
||||||
|
frames[0].L = frames[0].R = prevFrame.L + dL / 4; // 0.25 LR
|
||||||
|
frames[1].L = frames[1].R = prevFrame.L + dL / 2; // 0.50 LR
|
||||||
|
frames[2].L = frames[2].R = prevFrame.L + dL * 3 / 4; // 0.75 LR
|
||||||
|
}
|
||||||
|
frames[3] = prevFrame = frame; // 1.00 LR
|
||||||
|
return 4;
|
||||||
|
case 22050 :
|
||||||
|
if (channels == 2) {
|
||||||
|
frames[0].L = prevFrame.L + dL / 2; // 0.50 L
|
||||||
|
frames[0].R = prevFrame.R + dR / 2; // 0.50 R
|
||||||
|
} else
|
||||||
|
frames[0].L = frames[0].R = prevFrame.L + dL / 2; // 0.50 LR
|
||||||
|
frames[1] = prevFrame = frame; // 1.00 LR
|
||||||
|
return 2;
|
||||||
|
default : // impossible
|
||||||
|
ASSERT(false);
|
||||||
|
int k = 44100 / freq;
|
||||||
|
for (int i = 0; i < k; i++) frames[i] = frame; // no lerp
|
||||||
|
return k;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PCM : Decoder {
|
struct PCM : Decoder {
|
||||||
int freq, size, bits;
|
int size, bits;
|
||||||
Frame frameLast;
|
|
||||||
|
|
||||||
PCM(Stream *stream, int channels, int freq, int size, int bits) : Decoder(stream, channels), freq(freq), size(size), bits(bits) { frameLast.L = frameLast.R = 0; }
|
PCM(Stream *stream, int channels, int freq, int size, int bits) : Decoder(stream, channels, freq), size(size), bits(bits) {}
|
||||||
|
|
||||||
virtual int decode(Frame *frames, int count) {
|
virtual int decode(Frame *frames, int count) {
|
||||||
if (stream->pos - offset >= size) return 0;
|
if (stream->pos - offset >= size) return 0;
|
||||||
@@ -178,41 +222,7 @@ namespace Sound {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int dL = int(frame.L) - int(frameLast.L);
|
return resample(frames, frame);
|
||||||
int dR = int(frame.R) - int(frameLast.R);
|
|
||||||
switch (freq) {
|
|
||||||
case 11025 :
|
|
||||||
if (channels == 2) {
|
|
||||||
frames[0].L = frameLast.L + dL / 4; // 0.25 L
|
|
||||||
frames[0].R = frameLast.R + dR / 4; // 0.25 R
|
|
||||||
frames[1].L = frameLast.L + dL / 2; // 0.50 L
|
|
||||||
frames[1].R = frameLast.R + dR / 2; // 0.50 R
|
|
||||||
frames[2].L = frameLast.L + dL * 3 / 4; // 0.75 L
|
|
||||||
frames[2].R = frameLast.R + dR * 3 / 4; // 0.75 R
|
|
||||||
} else {
|
|
||||||
frames[0].L = frames[0].R = frameLast.L + dL / 4; // 0.25 LR
|
|
||||||
frames[1].L = frames[1].R = frameLast.L + dL / 2; // 0.50 LR
|
|
||||||
frames[2].L = frames[2].R = frameLast.L + dL * 3 / 4; // 0.75 LR
|
|
||||||
}
|
|
||||||
frames[3] = frameLast = frame; // 1.00 LR
|
|
||||||
return 4;
|
|
||||||
case 22050 :
|
|
||||||
if (channels == 2) {
|
|
||||||
frames[0].L = frameLast.L + dL / 2; // 0.50 L
|
|
||||||
frames[0].R = frameLast.R + dR / 2; // 0.50 R
|
|
||||||
} else
|
|
||||||
frames[0].L = frames[0].R = frameLast.L + dL / 2; // 0.50 LR
|
|
||||||
frames[1] = frameLast = frame; // 1.00 LR
|
|
||||||
return 2;
|
|
||||||
case 44100 : // not used
|
|
||||||
frames[0] = frameLast = frame;
|
|
||||||
return 1;
|
|
||||||
default : // impossible
|
|
||||||
ASSERT(false);
|
|
||||||
int k = 44100 / freq;
|
|
||||||
for (int i = 0; i < k; i++) frames[i] = frame; // no lerp
|
|
||||||
return k;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -220,7 +230,7 @@ namespace Sound {
|
|||||||
struct ADPCM : Decoder { // https://wiki.multimedia.cx/?title=Microsoft_ADPCM
|
struct ADPCM : Decoder { // https://wiki.multimedia.cx/?title=Microsoft_ADPCM
|
||||||
int size, block;
|
int size, block;
|
||||||
|
|
||||||
ADPCM(Stream *stream, int channels, int size, int block) : Decoder(stream, channels), size(size), block(block) {}
|
ADPCM(Stream *stream, int channels, int freq, int size, int block) : Decoder(stream, channels, freq), size(size), block(block) {}
|
||||||
|
|
||||||
struct Channel {
|
struct Channel {
|
||||||
int16 c1, c2;
|
int16 c1, c2;
|
||||||
@@ -290,6 +300,83 @@ namespace Sound {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DECODE_IMA
|
||||||
|
struct IMA : Decoder { // https://wiki.multimedia.cx/?title=Microsoft_ADPCM
|
||||||
|
struct State {
|
||||||
|
int amp, idx;
|
||||||
|
} state[2];
|
||||||
|
|
||||||
|
int freq;
|
||||||
|
|
||||||
|
IMA(Stream *stream, int channels, int freq) : Decoder(stream, channels, freq) {
|
||||||
|
memset(state, 0, sizeof(state));
|
||||||
|
}
|
||||||
|
|
||||||
|
int16 getSample(uint8 n, State &state) {
|
||||||
|
static int indexLUT[] = {
|
||||||
|
-1, -1, -1, -1, 2, 4, 6, 8
|
||||||
|
};
|
||||||
|
|
||||||
|
static int stepLUT[] = {
|
||||||
|
7, 8, 9, 10, 11, 12, 13, 14,
|
||||||
|
16, 17, 19, 21, 23, 25, 28, 31,
|
||||||
|
34, 37, 41, 45, 50, 55, 60, 66,
|
||||||
|
73, 80, 88, 97, 107, 118, 130, 143,
|
||||||
|
157, 173, 190, 209, 230, 253, 279, 307,
|
||||||
|
337, 371, 408, 449, 494, 544, 598, 658,
|
||||||
|
724, 796, 876, 963, 1060, 1166, 1282, 1411,
|
||||||
|
1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024,
|
||||||
|
3327, 3660, 4026, 4428, 4871, 5358, 5894, 6484,
|
||||||
|
7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899,
|
||||||
|
15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794,
|
||||||
|
32767
|
||||||
|
};
|
||||||
|
|
||||||
|
int step = stepLUT[state.idx];
|
||||||
|
|
||||||
|
state.idx += indexLUT[n & 7];
|
||||||
|
state.idx = clamp(state.idx, 0, 88);
|
||||||
|
|
||||||
|
int diff = step >> 3;
|
||||||
|
if (n & 1) diff += step >> 2;
|
||||||
|
if (n & 2) diff += step >> 1;
|
||||||
|
if (n & 4) diff += step;
|
||||||
|
|
||||||
|
if (n & 8) {
|
||||||
|
state.amp -= diff;
|
||||||
|
if (state.amp < -32768)
|
||||||
|
state.amp = -32768;
|
||||||
|
} else {
|
||||||
|
state.amp += diff;
|
||||||
|
if (state.amp > 32767)
|
||||||
|
state.amp = 32767;
|
||||||
|
}
|
||||||
|
|
||||||
|
return state.amp;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual int decode(Frame *frames, int count) {
|
||||||
|
uint8 n;
|
||||||
|
stream->read(n);
|
||||||
|
|
||||||
|
int a = getSample(n & 0x0F, state[0]);
|
||||||
|
int b = getSample(n >> 4, state[1 % channels]);
|
||||||
|
|
||||||
|
Frame frame;
|
||||||
|
if (channels == 2) {
|
||||||
|
frame.L = a;
|
||||||
|
frame.R = b;
|
||||||
|
return resample(frames, frame);
|
||||||
|
} else {
|
||||||
|
frame.L = frame.R = a;
|
||||||
|
int i = resample(frames, frame);
|
||||||
|
frame.L = frame.R = b;
|
||||||
|
return i + resample(frames + i, frame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DECODE_VAG
|
#ifdef DECODE_VAG
|
||||||
struct VAG : Decoder {
|
struct VAG : Decoder {
|
||||||
uint8 pred, shift, flags;
|
uint8 pred, shift, flags;
|
||||||
@@ -297,7 +384,7 @@ namespace Sound {
|
|||||||
Frame buffer[28 * 4];
|
Frame buffer[28 * 4];
|
||||||
int bufferSize;
|
int bufferSize;
|
||||||
|
|
||||||
VAG(Stream *stream) : Decoder(stream, 1), s1(0), s2(0), bufferSize(0) {}
|
VAG(Stream *stream) : Decoder(stream, 1, 11025), s1(0), s2(0), bufferSize(0) {}
|
||||||
|
|
||||||
void predicate(short value) {
|
void predicate(short value) {
|
||||||
int inc[] = { 0, 60, 115, 98, 122 };
|
int inc[] = { 0, 60, 115, 98, 122 };
|
||||||
@@ -369,7 +456,7 @@ namespace Sound {
|
|||||||
char *buffer;
|
char *buffer;
|
||||||
int size, pos;
|
int size, pos;
|
||||||
|
|
||||||
MP3(Stream *stream, int channels) : Decoder(stream, channels), size(stream->size), pos(0) {
|
MP3(Stream *stream, int channels) : Decoder(stream, channels, 0), size(stream->size), pos(0) {
|
||||||
mp3 = mp3_create();
|
mp3 = mp3_create();
|
||||||
buffer = new char[size]; // TODO: file streaming
|
buffer = new char[size]; // TODO: file streaming
|
||||||
stream->raw(buffer, size);
|
stream->raw(buffer, size);
|
||||||
@@ -409,7 +496,7 @@ namespace Sound {
|
|||||||
stb_vorbis *ogg;
|
stb_vorbis *ogg;
|
||||||
stb_vorbis_alloc alloc;
|
stb_vorbis_alloc alloc;
|
||||||
|
|
||||||
OGG(Stream *stream, int channels) : Decoder(stream, channels), ogg(NULL) {
|
OGG(Stream *stream, int channels) : Decoder(stream, channels, 0), ogg(NULL) {
|
||||||
char buf[255];
|
char buf[255];
|
||||||
strcpy(buf, Stream::contentDir);
|
strcpy(buf, Stream::contentDir);
|
||||||
strcat(buf, stream->name);
|
strcat(buf, stream->name);
|
||||||
@@ -420,6 +507,7 @@ namespace Sound {
|
|||||||
ASSERT(ogg);
|
ASSERT(ogg);
|
||||||
stb_vorbis_info info = stb_vorbis_get_info(ogg);
|
stb_vorbis_info info = stb_vorbis_get_info(ogg);
|
||||||
this->channels = info.channels;
|
this->channels = info.channels;
|
||||||
|
this->freq = info.sample_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~OGG() {
|
virtual ~OGG() {
|
||||||
@@ -512,7 +600,7 @@ namespace Sound {
|
|||||||
} else if (type == FOURCC("data")) {
|
} else if (type == FOURCC("data")) {
|
||||||
if (waveFmt.format == 1) decoder = new PCM(stream, waveFmt.channels, waveFmt.samplesPerSec, size, waveFmt.sampleBits);
|
if (waveFmt.format == 1) decoder = new PCM(stream, waveFmt.channels, waveFmt.samplesPerSec, size, waveFmt.sampleBits);
|
||||||
#ifdef DECODE_ADPCM
|
#ifdef DECODE_ADPCM
|
||||||
if (waveFmt.format == 2) decoder = new ADPCM(stream, waveFmt.channels, size, waveFmt.block);
|
if (waveFmt.format == 2) decoder = new ADPCM(stream, waveFmt.channels, size, waveFmt.block, waveFmt.samplesPerSec);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
} else
|
} else
|
||||||
|
97
src/video.h
97
src/video.h
@@ -10,21 +10,22 @@ struct Video {
|
|||||||
struct Decoder : Sound::Decoder {
|
struct Decoder : Sound::Decoder {
|
||||||
int width, height, fps;
|
int width, height, fps;
|
||||||
|
|
||||||
Decoder(Stream *stream) : Sound::Decoder(stream, 2) {}
|
Decoder(Stream *stream) : Sound::Decoder(stream, 2, 0) {}
|
||||||
virtual ~Decoder() { /* delete stream; */ }
|
virtual ~Decoder() { /* delete stream; */ }
|
||||||
virtual bool decode(uint8 *frame) { return false; }
|
virtual bool decode(uint8 *frame) { return false; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// based on ffmpeg code https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/escape124.c
|
// based on ffmpeg code https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/escape124.c
|
||||||
struct Escape124 : Decoder {
|
struct Escape : Decoder {
|
||||||
int vfmt, bpp;
|
int vfmt, bpp;
|
||||||
int sfmt, rate, channels, bps;
|
int sfmt, rate, channels, bps;
|
||||||
int framesCount, chunksCount, offset;
|
int framesCount, chunksCount, offset;
|
||||||
int curVideoPos, curVideoChunk;
|
int curVideoPos, curVideoChunk;
|
||||||
int curAudioPos, curAudioChunk;
|
int curAudioPos, curAudioChunk;
|
||||||
|
|
||||||
|
Sound::Decoder *audioDecoder;
|
||||||
|
|
||||||
uint32 *prevFrame, *nextFrame;
|
uint32 *prevFrame, *nextFrame;
|
||||||
Sound::Frame prevSample;
|
|
||||||
|
|
||||||
struct Chunk {
|
struct Chunk {
|
||||||
int offset;
|
int offset;
|
||||||
@@ -46,7 +47,7 @@ struct Video {
|
|||||||
MacroBlock *blocks;
|
MacroBlock *blocks;
|
||||||
} codebook[3];
|
} codebook[3];
|
||||||
|
|
||||||
Escape124(Stream *stream) : Decoder(stream), chunks(NULL) {
|
Escape(Stream *stream) : Decoder(stream), audioDecoder(NULL), chunks(NULL) {
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
skipLine();
|
skipLine();
|
||||||
|
|
||||||
@@ -89,10 +90,20 @@ struct Video {
|
|||||||
curVideoPos = curVideoChunk = 0;
|
curVideoPos = curVideoChunk = 0;
|
||||||
curAudioPos = curAudioChunk = 0;
|
curAudioPos = curAudioChunk = 0;
|
||||||
|
|
||||||
prevSample.L = prevSample.R = 0;
|
if (sfmt == 1)
|
||||||
|
audioDecoder = new Sound::PCM(stream, channels, rate, 0, bps); // TR2
|
||||||
|
else if (sfmt == 101)
|
||||||
|
if (bps == 8)
|
||||||
|
audioDecoder = new Sound::PCM(stream, channels, rate, 0, bps); // TR1
|
||||||
|
else
|
||||||
|
audioDecoder = new Sound::IMA(stream, channels, rate); // TR3
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~Escape124() {
|
virtual ~Escape() {
|
||||||
|
if (audioDecoder) {
|
||||||
|
audioDecoder->stream = NULL;
|
||||||
|
delete audioDecoder;
|
||||||
|
}
|
||||||
delete[] chunks;
|
delete[] chunks;
|
||||||
delete[] codebook[0].blocks;
|
delete[] codebook[0].blocks;
|
||||||
delete[] codebook[1].blocks;
|
delete[] codebook[1].blocks;
|
||||||
@@ -199,6 +210,16 @@ struct Video {
|
|||||||
}
|
}
|
||||||
stream->setPos(chunks[curVideoChunk].offset + curVideoPos);
|
stream->setPos(chunks[curVideoChunk].offset + curVideoPos);
|
||||||
|
|
||||||
|
switch (vfmt) {
|
||||||
|
case 124 : return decode124(frame);
|
||||||
|
case 130 : return decode130(frame);
|
||||||
|
default : ASSERT(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool decode124(uint8 *frame) {
|
||||||
uint32 flags, size;
|
uint32 flags, size;
|
||||||
stream->read(flags);
|
stream->read(flags);
|
||||||
stream->read(size);
|
stream->read(size);
|
||||||
@@ -323,55 +344,46 @@ struct Video {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool decode130(uint8 *frame) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
virtual int decode(Sound::Frame *frames, int count) {
|
virtual int decode(Sound::Frame *frames, int count) {
|
||||||
|
if (!audioDecoder) return 0;
|
||||||
|
|
||||||
if (abs(curAudioChunk - curVideoChunk) > 1) { // sync with video chunk
|
if (abs(curAudioChunk - curVideoChunk) > 1) { // sync with video chunk
|
||||||
curAudioChunk = curVideoChunk;
|
curAudioChunk = curVideoChunk;
|
||||||
curAudioPos = 0;
|
curAudioPos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (curAudioChunk >= chunksCount) {
|
int i = 0;
|
||||||
for (int i = 0; i < count; i++)
|
while (i < count) {
|
||||||
frames[i].L = frames[i].R = 0;
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
|
|
||||||
Chunk *chunk = &chunks[curAudioChunk];
|
|
||||||
stream->setPos(chunk->offset + chunk->videoSize + curAudioPos);
|
|
||||||
|
|
||||||
int sampleSize = channels * (bps / 8);
|
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
|
||||||
|
|
||||||
if (curAudioChunk >= chunksCount) {
|
if (curAudioChunk >= chunksCount) {
|
||||||
frames[i].L = frames[i].R = 0;
|
memset(&frames[i], 0, sizeof(Sound::Frame) * (count - i));
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sfmt == 101) {
|
Chunk *chunk = &chunks[curAudioChunk];
|
||||||
ubyte2 sample;
|
|
||||||
stream->raw(&sample, sizeof(sample));
|
|
||||||
frames[i].L = uint16(sample.x) << 7;
|
|
||||||
frames[i].R = uint16(sample.y) << 7;
|
|
||||||
} else if (sfmt == 1) {
|
|
||||||
Sound::Frame sample;
|
|
||||||
|
|
||||||
stream->raw(&sample, sizeof(Sound::Frame));
|
|
||||||
|
|
||||||
frames[i].L = (int(prevSample.L) + int(sample.L)) / 2;
|
|
||||||
frames[i].R = (int(prevSample.R) + int(sample.R)) / 2;
|
|
||||||
i++;
|
|
||||||
frames[i] = prevSample = sample;
|
|
||||||
}
|
|
||||||
|
|
||||||
curAudioPos += sampleSize;
|
|
||||||
if (curAudioPos >= chunk->audioSize) {
|
if (curAudioPos >= chunk->audioSize) {
|
||||||
curAudioPos = 0;
|
curAudioPos = 0;
|
||||||
curAudioChunk++;
|
curAudioChunk++;
|
||||||
if (curAudioChunk < chunksCount) {
|
continue;
|
||||||
chunk = &chunks[curAudioChunk];
|
|
||||||
stream->setPos(chunk->offset + chunk->videoSize);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stream->setPos(chunk->offset + chunk->videoSize + curAudioPos);
|
||||||
|
|
||||||
|
int part = min(count - i, (chunk->audioSize - curAudioPos) / (channels * bps / 8));
|
||||||
|
|
||||||
|
int pos = stream->pos;
|
||||||
|
|
||||||
|
while (part > 0) {
|
||||||
|
int res = audioDecoder->decode(&frames[i], part);
|
||||||
|
i += res;
|
||||||
|
part -= res;
|
||||||
|
}
|
||||||
|
|
||||||
|
curAudioPos += stream->pos - pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
@@ -382,7 +394,6 @@ struct Video {
|
|||||||
Texture *frameTex[2];
|
Texture *frameTex[2];
|
||||||
uint8 *frameData;
|
uint8 *frameData;
|
||||||
float time, step;
|
float time, step;
|
||||||
float invFPS;
|
|
||||||
bool isPlaying;
|
bool isPlaying;
|
||||||
bool needUpdate;
|
bool needUpdate;
|
||||||
Sound::Sample *sample;
|
Sound::Sample *sample;
|
||||||
@@ -392,7 +403,7 @@ struct Video {
|
|||||||
|
|
||||||
if (!stream) return;
|
if (!stream) return;
|
||||||
|
|
||||||
decoder = new Escape124(stream);
|
decoder = new Escape(stream);
|
||||||
frameData = new uint8[decoder->width * decoder->height * 4];
|
frameData = new uint8[decoder->width * decoder->height * 4];
|
||||||
memset(frameData, 0, decoder->width * decoder->height * 4);
|
memset(frameData, 0, decoder->width * decoder->height * 4);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user