mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-15 23:06:40 +00:00
Use av_samples_get_buffer_size.
This commit is contained in:
parent
9508cc4eb3
commit
9ce3331f04
@ -137,7 +137,11 @@ static bool init_audio(struct ff_audio_info *audio, struct ffemu_params *param)
|
||||
return false;
|
||||
}
|
||||
|
||||
audio->buffer = (int16_t*)av_malloc(audio->codec->frame_size * param->channels * sizeof(int16_t));
|
||||
audio->buffer = (int16_t*)av_malloc(av_samples_get_buffer_size(NULL,
|
||||
audio->codec->channels,
|
||||
audio->codec->frame_size,
|
||||
audio->codec->sample_fmt, 1));
|
||||
|
||||
if (!audio->buffer)
|
||||
return false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user