mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
[bugfix]: Validate audio sample range, catch AudioContext error (#470)
This commit is contained in:
parent
3bca85b3a8
commit
5f1d0a3b5e
4 changed files with 32 additions and 8 deletions
|
|
@ -206,11 +206,16 @@ export const MpvSettings = () => {
|
|||
{
|
||||
control: (
|
||||
<NumberInput
|
||||
defaultValue={settings.mpvProperties.audioSampleRateHz}
|
||||
defaultValue={settings.mpvProperties.audioSampleRateHz || undefined}
|
||||
max={192000}
|
||||
min={0}
|
||||
placeholder="48000"
|
||||
rightSection="Hz"
|
||||
width={100}
|
||||
onBlur={(e) => {
|
||||
const value = Number(e.currentTarget.value);
|
||||
handleSetMpvProperty('audioSampleRateHz', value > 0 ? value : undefined);
|
||||
// Setting a value of `undefined` causes an error for MPV. Use 0 instead
|
||||
handleSetMpvProperty('audioSampleRateHz', value >= 8000 ? value : value);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue