Skip to content

Commit dcdb583

Browse files
committed
fix: Fixed crash when changing crossfeed modes
1 parent 4cabff1 commit dcdb583

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/audio/base/DspHost.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -461,11 +461,6 @@ void DspHost::updateCrossfeed(DspConfig* config)
461461
{
462462
CrossfeedChangeMode(cast(this->_dsp), mode);
463463
}
464-
465-
if(enabled)
466-
CrossfeedEnable(cast(this->_dsp), 1);
467-
else
468-
CrossfeedDisable(cast(this->_dsp));
469464
}
470465

471466
void DspHost::updateFromCache()
@@ -488,7 +483,7 @@ bool DspHost::update(DspConfig *config, bool ignoreCache)
488483
bool refreshCompander = false;
489484

490485
#ifdef DEBUG_FPE
491-
feenableexcept(FE_ALL_EXCEPT & ~FE_INEXACT);
486+
feenableexcept(FE_ALL_EXCEPT & ~FE_INEXACT & ~FE_INVALID);
492487
#endif
493488

494489
for (int k = 0; k < e.keyCount(); k++)
@@ -545,6 +540,11 @@ bool DspHost::update(DspConfig *config, bool ignoreCache)
545540
refreshConvolver = true;
546541
break;
547542
case DspConfig::crossfeed_enable:
543+
if(current.toBool())
544+
CrossfeedEnable(cast(this->_dsp), 1);
545+
else
546+
CrossfeedDisable(cast(this->_dsp));
547+
break;
548548
case DspConfig::crossfeed_bs2b_fcut:
549549
case DspConfig::crossfeed_bs2b_feed:
550550
case DspConfig::crossfeed_mode:
@@ -672,7 +672,7 @@ bool DspHost::update(DspConfig *config, bool ignoreCache)
672672
}
673673

674674
#ifdef DEBUG_FPE
675-
fedisableexcept(FE_ALL_EXCEPT & ~FE_INEXACT);
675+
fedisableexcept(FE_ALL_EXCEPT & ~FE_INEXACT & ~FE_INVALID);
676676
#endif
677677
return true;
678678
}

src/audio/pipewire/PwJamesDspPlugin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void PwJamesDspPlugin::process(float* left_in,
8383
}
8484

8585
#ifdef DEBUG_FPE
86-
feenableexcept(FPE_INTDIV | FPE_FLTDIV);
86+
feenableexcept(FE_DIVBYZERO);
8787
#endif
8888
this->dsp->processFloatDeinterleaved(this->dsp, left_in, right_in, left_out, right_out, length);
8989

@@ -95,7 +95,7 @@ void PwJamesDspPlugin::process(float* left_in,
9595
}
9696
}
9797
#ifdef DEBUG_FPE
98-
fedisableexcept(FPE_INTDIV | FPE_FLTDIV);
98+
fedisableexcept(FE_DIVBYZERO);
9999
#endif
100100
}
101101

0 commit comments

Comments
 (0)