mirror of https://github.com/snes9xgit/snes9x.git
Fix silence adder.
This commit is contained in:
parent
7f20a93637
commit
dd2072b28e
|
@ -99,12 +99,12 @@ class Resampler
|
|||
|
||||
inline void add_silence(unsigned int num_samples)
|
||||
{
|
||||
if ((unsigned int)space_empty() <= num_samples)
|
||||
{
|
||||
if ((unsigned int)space_empty() < num_samples)
|
||||
return;
|
||||
|
||||
int new_end = (end + num_samples) % buffer_size;
|
||||
|
||||
if (new_end < end)
|
||||
{
|
||||
if (new_end < end) {
|
||||
memset(buffer + end, 0, 2 * (buffer_size - end));
|
||||
memset(buffer, 0, 2 * (num_samples - (buffer_size - end)));
|
||||
}
|
||||
|
@ -112,7 +112,6 @@ class Resampler
|
|||
memset(buffer + end, 0, 2 * num_samples);
|
||||
end = new_end;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool pull(int16_t *dst, int num_samples)
|
||||
{
|
||||
|
|
|
@ -53,7 +53,13 @@ void FoldersPanel::refreshEntry(QComboBox *combo, QLineEdit *lineEdit, QPushButt
|
|||
{
|
||||
bool custom = (*location == EmuConfig::eCustomDirectory);
|
||||
combo->setCurrentIndex(*location);
|
||||
lineEdit->setText(custom ? QString::fromUtf8(*folder) : "");
|
||||
if (custom)
|
||||
lineEdit->setText(QString::fromUtf8(*folder));
|
||||
else if (*location == EmuConfig::eConfigDirectory)
|
||||
lineEdit->setText(tr("Config folder is %1").arg(app->config->findConfigDir().c_str()));
|
||||
else
|
||||
lineEdit->clear();
|
||||
|
||||
lineEdit->setEnabled(custom);
|
||||
browse->setEnabled(custom);
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ void Throttle::wait_for_frame()
|
|||
|
||||
auto time_to_wait = remaining();
|
||||
|
||||
if (time_to_wait < -frame_duration_us / 10)
|
||||
if (time_to_wait < -frame_duration_us)
|
||||
{
|
||||
reset();
|
||||
return;
|
||||
|
@ -57,7 +57,7 @@ void Throttle::wait_for_frame()
|
|||
{
|
||||
auto time_to_wait = remaining();
|
||||
|
||||
if (time_to_wait < -frame_duration_us / 10)
|
||||
if (time_to_wait < -frame_duration_us)
|
||||
{
|
||||
reset();
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue