You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Experimental: Adding some fsanitize flags, a new example exe, a mutex on FFmpegReader::Close, and some additional clean-up code on AddImage (when a previous image exists)
This commit is contained in:
@@ -584,6 +584,8 @@ void FFmpegReader::Open() {
|
||||
void FFmpegReader::Close() {
|
||||
// Close all objects, if reader is 'open'
|
||||
if (is_open) {
|
||||
const std::lock_guard<std::recursive_mutex> lock(processingMutex);
|
||||
|
||||
// Mark as "closed"
|
||||
is_open = false;
|
||||
ZmqLogger::Instance()->AppendDebugMethod("FFmpegReader::Close (Start)");
|
||||
@@ -1335,7 +1337,7 @@ void FFmpegReader::ProcessVideoPacket(int64_t requested_frame) {
|
||||
|
||||
// Determine required buffer size and allocate buffer
|
||||
const int bytes_per_pixel = 4;
|
||||
int buffer_size = width * height * bytes_per_pixel;
|
||||
int buffer_size = (width * height * bytes_per_pixel) + 128;
|
||||
buffer = new unsigned char[buffer_size]();
|
||||
|
||||
// Copy picture data from one AVFrame (or AVPicture) to another one.
|
||||
@@ -2135,6 +2137,10 @@ void FFmpegReader::CheckWorkingFrames(int64_t requested_frame) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Clear vector of frames
|
||||
working_frames.clear();
|
||||
working_frames.shrink_to_fit();
|
||||
}
|
||||
|
||||
// Check for the correct frames per second (FPS) value by scanning the 1st few seconds of video packets.
|
||||
|
||||
Reference in New Issue
Block a user