mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
[bugfix]: Validate audio sample range, catch AudioContext error (#470)
This commit is contained in:
@@ -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);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user