Bink: s/ReadFrame/ReadPacket
This commit is contained in:
parent
1fa524ff67
commit
2793d4f39b
1 changed files with 5 additions and 5 deletions
10
src/bink.c
10
src/bink.c
|
@ -265,14 +265,14 @@ static int DecodeAudioFrame(struct binkMovie* aMovie)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ReadFrame(struct binkMovie* aMovie)
|
static int ReadPacket(struct binkMovie* aMovie)
|
||||||
{
|
{
|
||||||
// Read from file if no packet is buffered.
|
// Read from file if no packet is buffered.
|
||||||
if (!aMovie->packet.buf && av_read_frame(aMovie->avContext, &aMovie->packet) < 0) {
|
if (!aMovie->packet.buf && av_read_frame(aMovie->avContext, &aMovie->packet) < 0) {
|
||||||
// No more packets in file.
|
// No more packets in file.
|
||||||
if (aMovie->looping) {
|
if (aMovie->looping) {
|
||||||
av_seek_frame(aMovie->avContext, -1, 0, 0);
|
av_seek_frame(aMovie->avContext, -1, 0, 0);
|
||||||
return ReadFrame(aMovie);
|
return ReadPacket(aMovie);
|
||||||
} else {
|
} else {
|
||||||
// Drain buffered frames.
|
// Drain buffered frames.
|
||||||
if (aMovie->videoStreamIndex >= 0)
|
if (aMovie->videoStreamIndex >= 0)
|
||||||
|
@ -377,7 +377,7 @@ static int BinkStartMovie(struct binkMovie* aMovie, const char* aFilename,
|
||||||
|
|
||||||
if (!aFmvFlag) {
|
if (!aFmvFlag) {
|
||||||
for (int i = 0; i < (FRAMEQUEUESIZE-1) * numStreams; i++)
|
for (int i = 0; i < (FRAMEQUEUESIZE-1) * numStreams; i++)
|
||||||
ReadFrame(aMovie);
|
ReadPacket(aMovie);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -389,7 +389,7 @@ static int BinkUpdateMovie(struct binkMovie* aMovie)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
const int t = SDL_GetTicks();
|
const int t = SDL_GetTicks();
|
||||||
const int eof = !ReadFrame(aMovie);
|
const int eof = !ReadPacket(aMovie);
|
||||||
|
|
||||||
int playing = 0;
|
int playing = 0;
|
||||||
if (aMovie->videoStreamIndex >= 0) {
|
if (aMovie->videoStreamIndex >= 0) {
|
||||||
|
@ -479,7 +479,7 @@ int PlayMusicBink(int volume)
|
||||||
int processedBuffers = 0;
|
int processedBuffers = 0;
|
||||||
alGetSourcei(musicMovie.alSource, AL_BUFFERS_PROCESSED, &processedBuffers);
|
alGetSourcei(musicMovie.alSource, AL_BUFFERS_PROCESSED, &processedBuffers);
|
||||||
if (processedBuffers + musicMovie.alNumFreeBuffers > 0)
|
if (processedBuffers + musicMovie.alNumFreeBuffers > 0)
|
||||||
if (!ReadFrame(&musicMovie))
|
if (!ReadPacket(&musicMovie))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue