Bink: minor reorder in AL init
This commit is contained in:
parent
2515a50a52
commit
b9e2075c7e
1 changed files with 2 additions and 6 deletions
|
@ -103,12 +103,12 @@ static void BinkReleaseMovie(struct binkMovie* aMovie)
|
|||
BinkInitMovieStruct(aMovie);
|
||||
}
|
||||
|
||||
|
||||
static int DecodeVideoFrame(struct binkMovie* aMovie)
|
||||
{
|
||||
if (avcodec_receive_frame(aMovie->videoCodecContext, aMovie->videoFrame) != 0)
|
||||
return 0;
|
||||
|
||||
// Initialize scale context.
|
||||
if (aMovie->videoScaleContext == NULL) {
|
||||
if (aMovie->videoScaleWidth == 0)
|
||||
aMovie->videoScaleWidth = aMovie->videoFrame->width;
|
||||
|
@ -344,11 +344,6 @@ static int BinkStartMovie(struct binkMovie* aMovie, const char* aFilename,
|
|||
aMovie->audioFrame = av_frame_alloc();
|
||||
|
||||
alGenSources(1, &aMovie->alSource);
|
||||
AL_CHECK();
|
||||
|
||||
alGenBuffers(FRAMEQUEUESIZE, aMovie->alBuffers);
|
||||
AL_CHECK();
|
||||
|
||||
alSource3f(aMovie->alSource, AL_POSITION, 0.0, 0.0, 0.0);
|
||||
alSource3f(aMovie->alSource, AL_VELOCITY, 0.0, 0.0, 0.0);
|
||||
alSource3f(aMovie->alSource, AL_DIRECTION, 0.0, 0.0, 0.0);
|
||||
|
@ -357,6 +352,7 @@ static int BinkStartMovie(struct binkMovie* aMovie, const char* aFilename,
|
|||
alSourcef(aMovie->alSource, AL_PITCH, 1.0);
|
||||
alSourcef(aMovie->alSource, AL_GAIN, 1.0);
|
||||
|
||||
alGenBuffers(FRAMEQUEUESIZE, aMovie->alBuffers);
|
||||
aMovie->alNumFreeBuffers = FRAMEQUEUESIZE;
|
||||
for (int i = 0; i < aMovie->alNumFreeBuffers; i++)
|
||||
aMovie->alFreeBuffers[i] = aMovie->alBuffers[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue