mirror of
https://github.com/holub/mame
synced 2025-06-28 07:04:35 +03:00
Fix 01815: All Sets: Saved machine states do not properly adjust to changes in -samplerate
This commit is contained in:
parent
41372cf177
commit
f4523617ed
@ -120,6 +120,7 @@ static TIMER_CALLBACK( sound_update );
|
|||||||
static void start_sound_chips(void);
|
static void start_sound_chips(void);
|
||||||
static void route_sound(void);
|
static void route_sound(void);
|
||||||
static void mixer_update(void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length);
|
static void mixer_update(void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length);
|
||||||
|
static STATE_POSTLOAD( mixer_postload );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -397,6 +398,7 @@ static void route_sound(void)
|
|||||||
if (info->inputs != 0)
|
if (info->inputs != 0)
|
||||||
{
|
{
|
||||||
info->mixer_stream = stream_create(info->inputs, 1, Machine->sample_rate, info, mixer_update);
|
info->mixer_stream = stream_create(info->inputs, 1, Machine->sample_rate, info, mixer_update);
|
||||||
|
state_save_register_postload(Machine, mixer_postload, info->mixer_stream);
|
||||||
info->input = auto_malloc(info->inputs * sizeof(*info->input));
|
info->input = auto_malloc(info->inputs * sizeof(*info->input));
|
||||||
info->inputs = 0;
|
info->inputs = 0;
|
||||||
}
|
}
|
||||||
@ -791,6 +793,18 @@ static void mixer_update(void *param, stream_sample_t **inputs, stream_sample_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*-------------------------------------------------
|
||||||
|
mixer_postload - postload function to reset
|
||||||
|
the mixer stream to the proper sample rate
|
||||||
|
-------------------------------------------------*/
|
||||||
|
|
||||||
|
static STATE_POSTLOAD( mixer_postload )
|
||||||
|
{
|
||||||
|
sound_stream *stream = param;
|
||||||
|
stream_set_sample_rate(stream, machine->sample_rate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
SPEAKER OUTPUT DEVICE INTERFACE
|
SPEAKER OUTPUT DEVICE INTERFACE
|
||||||
|
Loading…
Reference in New Issue
Block a user