You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Fix many bugs around FPS and video length calculation (especially for MP3 and streaming WEBM formats). Also protecting samples_per_frame calculation to keep from crashing on undetected FPS.
This commit is contained in:
@@ -512,6 +512,8 @@ int Frame::GetSamplesPerFrame(int64_t number, Fraction fps, int sample_rate, int
|
||||
// Subtract the previous frame's total samples with this frame's total samples. Not all sample rates can
|
||||
// be evenly divided into frames, so each frame can have have different # of samples.
|
||||
int samples_per_frame = round(total_samples - previous_samples);
|
||||
if (samples_per_frame < 0)
|
||||
samples_per_frame = 0;
|
||||
return samples_per_frame;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user