Files
xtremflow/lib/core/services
GitHub CopilotandClaude Haiku 4.5 29888c9b2a fix(adaptive-bitrate): correct operator precedence in bitrate calculations
Fixed NaN errors in FFmpeg bitrate argument generation by ensuring integer
conversion happens before integer division. The double multiplication (1.5, 2.0)
was happening before the ~/ operator, causing NaN values. Now properly converts
to int first, then divides.

- maxRateArg: ((bitrateBps * 1.5).toInt() ~/ 1000)
- bufferSizeArg: ((bitrateBps * 2).toInt() ~/ 1000)

Fixes: Unsupported operation: Result of truncating division is NaN

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-26 15:26:50 +01:00
..