Re: [hatari-devel] SDL1 vs. SDL2 sound pausing |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Le 10/09/2016 à 11:30, Nicolas Pomarède a écrit :
> Le 10/09/2016 à 11:17, Jerome Vernet a écrit :
> this could be possible ; in that case, maybe SDL2 has different option
> when sound buffer is not filled fast enough ? (eg: loop on latest data =
> noise, play empty sample instead (which would be better), ...)
One thing also found on SDL Wiki Migrating from SDL1 to SDL2:
"That one really important exception: The audio callback does NOT start
with a fully initialized buffer anymore. You must fully write to the
buffer in all cases. If you don't have enough audio, your callback
should write silence. If you fail to do this, you'll hear repeated
audio, or maybe audio corruption. If you want to restore the old
behavior of unconditionally initializing the buffer, just put an
SDL_memset(stream, 0, len) at the start of your callback. "
I'm looking at Audio_CallBack to see how it work, but I do not know how
SDL sound work...
If the main emulation thread is paused or do not feed it, what is played
by this callback ??
I also noted that The very first call (at boot) at this callback produce
a short blank noise. Incorrect initalised buffer ?