You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Merge pull request #930 from kxxt/fix/Frame/GetSamplesPerFrame
Fix Frame::GetSamplesPerFrame when channels = 0
This commit is contained in:
@@ -455,6 +455,10 @@ void Frame::SetFrameNumber(int64_t new_number)
|
||||
// Calculate the # of samples per video frame (for a specific frame number and frame rate)
|
||||
int Frame::GetSamplesPerFrame(int64_t number, Fraction fps, int sample_rate, int channels)
|
||||
{
|
||||
// Directly return 0 if there are no channels
|
||||
// so that we do not need to deal with NaNs later
|
||||
if (channels == 0) return 0;
|
||||
|
||||
// Get the total # of samples for the previous frame, and the current frame (rounded)
|
||||
double fps_rate = fps.Reciprocal().ToDouble();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user