Bink: s/ReadFrame/ReadPacket

This commit is contained in:
Timotej Lazar 2020-05-31 13:02:27 +02:00
parent 1fa524ff67
commit 2793d4f39b

View file

@ -265,14 +265,14 @@ static int DecodeAudioFrame(struct binkMovie* aMovie)
return 1;
}
static int ReadFrame(struct binkMovie* aMovie)
static int ReadPacket(struct binkMovie* aMovie)
{
// Read from file if no packet is buffered.
if (!aMovie->packet.buf && av_read_frame(aMovie->avContext, &aMovie->packet) < 0) {
// No more packets in file.
if (aMovie->looping) {
av_seek_frame(aMovie->avContext, -1, 0, 0);
return ReadFrame(aMovie);
return ReadPacket(aMovie);
} else {
// Drain buffered frames.
if (aMovie->videoStreamIndex >= 0)
@ -377,7 +377,7 @@ static int BinkStartMovie(struct binkMovie* aMovie, const char* aFilename,
if (!aFmvFlag) {
for (int i = 0; i < (FRAMEQUEUESIZE-1) * numStreams; i++)
ReadFrame(aMovie);
ReadPacket(aMovie);
}
return 1;
@ -389,7 +389,7 @@ static int BinkUpdateMovie(struct binkMovie* aMovie)
return 0;
const int t = SDL_GetTicks();
const int eof = !ReadFrame(aMovie);
const int eof = !ReadPacket(aMovie);
int playing = 0;
if (aMovie->videoStreamIndex >= 0) {
@ -479,7 +479,7 @@ int PlayMusicBink(int volume)
int processedBuffers = 0;
alGetSourcei(musicMovie.alSource, AL_BUFFERS_PROCESSED, &processedBuffers);
if (processedBuffers + musicMovie.alNumFreeBuffers > 0)
if (!ReadFrame(&musicMovie))
if (!ReadPacket(&musicMovie))
return 0;
}
return 1;