You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Break out of cache loop if playback speed changes during caching. Move getFrame() below pause code, to prevent accidental incrementing video_position.
This commit is contained in:
@@ -79,6 +79,7 @@ namespace openshot
|
||||
while (!threadShouldExit() && is_playing) {
|
||||
// Calculate on-screen time for a single frame
|
||||
const auto frame_duration = double_micro_sec(1000000.0 / reader->info.fps.ToDouble());
|
||||
int current_speed = speed;
|
||||
|
||||
// Calculate bytes per frame. If we have a reference openshot::Frame, use that instead (the preview
|
||||
// window can be smaller, can thus reduce the bytes per frame)
|
||||
@@ -141,6 +142,10 @@ namespace openshot
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Check if playback speed changed (if so, break out of cache loop)
|
||||
if (current_speed != speed) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Update current display frame
|
||||
|
||||
Reference in New Issue
Block a user