You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -941,6 +941,12 @@ void Timeline::SetJsonValue(Json::Value root) throw(InvalidFile, ReaderClosed) {
|
||||
AddEffect(e);
|
||||
}
|
||||
}
|
||||
|
||||
if (!root["duration"].isNull()) {
|
||||
// Update duration of timeline
|
||||
info.duration = root["duration"].asDouble();
|
||||
info.video_length = info.fps.ToFloat() * info.duration;
|
||||
}
|
||||
}
|
||||
|
||||
// Apply a special formatted JSON object, which represents a change to the timeline (insert, update, delete)
|
||||
@@ -1208,8 +1214,11 @@ void Timeline::apply_json_to_timeline(Json::Value change) throw(InvalidJSONKey)
|
||||
else if (root_key == "viewport_y")
|
||||
// Set viewport y offset
|
||||
viewport_y.SetJsonValue(change["value"]);
|
||||
else if (root_key == "duration") { }
|
||||
// Ignore for now
|
||||
else if (root_key == "duration") {
|
||||
// Update duration of timeline
|
||||
info.duration = change["value"].asDouble();
|
||||
info.video_length = info.fps.ToFloat() * info.duration;
|
||||
}
|
||||
else if (root_key == "width")
|
||||
// Set width
|
||||
info.width = change["value"].asInt();
|
||||
|
||||
Reference in New Issue
Block a user