]> git.sesse.net Git - nageru/blobdiff - mixer.cpp
Fix a possible int32 overload with huge framerate denominators.
[nageru] / mixer.cpp
index 19cb8bee202dacc708ea9430f4b98a3fa7969807..80b0df1ea0df60d852bc530cb0d5535e99e2f92a 100644 (file)
--- a/mixer.cpp
+++ b/mixer.cpp
@@ -359,7 +359,7 @@ void Mixer::bm_frame(unsigned card_index, uint16_t timecode,
                }
        }
 
-       int64_t frame_length = int64_t(TIMEBASE * video_format.frame_rate_den) / video_format.frame_rate_nom;
+       int64_t frame_length = int64_t(TIMEBASE) * video_format.frame_rate_den / video_format.frame_rate_nom;
 
        size_t num_samples = (audio_frame.len > audio_offset) ? (audio_frame.len - audio_offset) / audio_format.num_channels / (audio_format.bits_per_sample / 8) : 0;
        if (num_samples > OUTPUT_FREQUENCY / 10) {