mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-17 10:18:28 +00:00
audio: Add channel remapping to SDL_AudioSpec and SDL_AudioStream.
Fixes #8367.
This commit is contained in:
parent
0367f1af19
commit
16e7fdc4f2
12 changed files with 254 additions and 193 deletions
|
@ -1167,7 +1167,7 @@ static AVCodecContext *OpenAudioStream(AVFormatContext *ic, int stream, const AV
|
|||
return NULL;
|
||||
}
|
||||
|
||||
SDL_AudioSpec spec = { SDL_AUDIO_F32, codecpar->ch_layout.nb_channels, codecpar->sample_rate };
|
||||
SDL_AudioSpec spec = { SDL_AUDIO_F32, codecpar->ch_layout.nb_channels, codecpar->sample_rate, SDL_FALSE };
|
||||
audio = SDL_OpenAudioDeviceStream(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec, NULL, NULL);
|
||||
if (audio) {
|
||||
SDL_ResumeAudioDevice(SDL_GetAudioStreamDevice(audio));
|
||||
|
@ -1240,7 +1240,7 @@ static void InterleaveAudio(AVFrame *frame, const SDL_AudioSpec *spec)
|
|||
static void HandleAudioFrame(AVFrame *frame)
|
||||
{
|
||||
if (audio) {
|
||||
SDL_AudioSpec spec = { GetAudioFormat(frame->format), frame->ch_layout.nb_channels, frame->sample_rate };
|
||||
SDL_AudioSpec spec = { GetAudioFormat(frame->format), frame->ch_layout.nb_channels, frame->sample_rate, SDL_FALSE };
|
||||
SDL_SetAudioStreamFormat(audio, &spec, NULL);
|
||||
|
||||
if (frame->ch_layout.nb_channels > 1 && IsPlanarAudioFormat(frame->format)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue