Fix another leak.

This commit is contained in:
Damiano Galassi committed 2017-10-01 16:34:44 +02:00
1 parent 15003882f8
commit a668a5c949
1 file changed
+4 -2
+4 -2
View File
@@ -38,6 +38,7 @@ struct MP42DecodeContext {
int drop_samples;
BOOL configured;
BOOL outputConfigured;
};
typedef struct MP42DecodeContext MP42DecodeContext;
@@ -398,6 +399,7 @@ static int resample(MP42DecodeContext *context, AVFrame *frame, uint8_t **output
context->matrix_encoding,
context->outputFormat->mSampleRate,
0);
context->configured = YES;
}
if (!context->resampler) {
@@ -542,9 +544,9 @@ static inline void enqueue(MP42AudioDecoder *self, MP42SampleBuffer *outSample)
else {
send_packet(_context, sampleBuffer);
while (!receive_frame(_context, &outSample)) {
if (_context->configured == NO && outSample) {
if (_context->outputConfigured == NO && outSample) {
[_outputUnit reconfigure];
_context->configured = YES;
_context->outputConfigured = YES;
}
enqueue(self, outSample);
}