mirror of
https://github.com/libretro/RetroArch
synced 2025-02-25 21:41:03 +00:00
Revert "Avoid redundant copy. Remove some now unneeded ifdefs."
This reverts commit b52110f6420e8891cfb92c01869c54bf9661e63c.
This commit is contained in:
parent
b52110f642
commit
8ff9ae6b32
12
ssnes.c
12
ssnes.c
@ -288,10 +288,12 @@ static bool audio_flush(const int16_t *data, size_t samples)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef SSNES_CONSOLE
|
||||
if (g_extern.is_paused)
|
||||
return true;
|
||||
if (!g_extern.audio_active)
|
||||
return false;
|
||||
#endif
|
||||
|
||||
const float *output_data = NULL;
|
||||
unsigned output_frames = 0;
|
||||
@ -317,8 +319,10 @@ static bool audio_flush(const int16_t *data, size_t samples)
|
||||
src_data.data_out = g_extern.audio_data.outsamples;
|
||||
src_data.input_frames = dsp_output.samples ? dsp_output.frames : (samples / 2);
|
||||
|
||||
#ifndef SSNES_CONSOLE
|
||||
if (g_extern.audio_data.rate_control)
|
||||
readjust_audio_input_rate();
|
||||
#endif
|
||||
|
||||
src_data.ratio = g_extern.audio_data.src_ratio;
|
||||
if (g_extern.is_slowmotion)
|
||||
@ -399,9 +403,15 @@ unsigned audio_sample_batch(const int16_t *data, unsigned frames)
|
||||
if (frames > (AUDIO_CHUNK_SIZE_NONBLOCKING >> 1))
|
||||
frames = AUDIO_CHUNK_SIZE_NONBLOCKING >> 1;
|
||||
|
||||
memcpy(g_extern.audio_data.conv_outsamples,
|
||||
data, (frames << 1) * sizeof(int16_t));
|
||||
g_extern.audio_data.data_ptr = frames << 1;
|
||||
|
||||
if (g_extern.audio_data.data_ptr >= g_extern.audio_data.chunk_size)
|
||||
{
|
||||
g_extern.audio_active = audio_flush(data, frames << 1) && g_extern.audio_active;
|
||||
g_extern.audio_active = audio_flush(g_extern.audio_data.conv_outsamples,
|
||||
g_extern.audio_data.data_ptr) && g_extern.audio_active;
|
||||
|
||||
g_extern.audio_data.data_ptr = 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user