Implementing a small memory bug fix with regards to AV_FREE_FRAME and audio_frame. Also adding in support for duration to be set by JSON, to support long videos from openshot-qt.

This commit is contained in:
Jonathan Thomas
2016-08-15 00:44:51 -05:00
parent 98ccfb5ee1
commit 28cc591faf
2 changed files with 14 additions and 3 deletions

View File

@@ -1050,7 +1050,6 @@ void FFmpegReader::ProcessAudioPacket(long int requested_frame, long int target_
avr = NULL;
// Free AVFrames
AV_FREE_FRAME(&audio_frame);
av_free(audio_converted->data[0]);
AV_FREE_FRAME(&audio_converted);
@@ -1183,6 +1182,9 @@ void FFmpegReader::ProcessAudioPacket(long int requested_frame, long int target_
// TODO: Fix this bug. Wait on the task to complete. This is not ideal, but solves an issue with the
// audio_frame being modified by the next call to this method. I think this is a scope issue with OpenMP.
#pragma omp taskwait
// Free audio frame
AV_FREE_FRAME(&audio_frame);
}