Merge branch 'master' of github.com:Themaister/SSNES
This commit is contained in:
commit
d3d97bf11e
|
@ -137,10 +137,10 @@ static bool init_audio(struct ff_audio_info *audio, struct ffemu_params *param)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
audio->buffer = (int16_t*)av_malloc(av_samples_get_buffer_size(NULL,
|
audio->buffer = (int16_t*)av_malloc(
|
||||||
audio->codec->channels,
|
audio->codec->frame_size *
|
||||||
audio->codec->frame_size,
|
audio->codec->channels *
|
||||||
audio->codec->sample_fmt, 1));
|
sizeof(int16_t));
|
||||||
|
|
||||||
if (!audio->buffer)
|
if (!audio->buffer)
|
||||||
return false;
|
return false;
|
||||||
|
@ -600,10 +600,9 @@ static bool ffemu_push_audio_thread(ffemu_t *handle, const struct ffemu_audio_da
|
||||||
frame.nb_samples = handle->audio.frames_in_buffer;
|
frame.nb_samples = handle->audio.frames_in_buffer;
|
||||||
frame.pts = handle->audio.frame_cnt;
|
frame.pts = handle->audio.frame_cnt;
|
||||||
|
|
||||||
int samples_size = av_samples_get_buffer_size(NULL,
|
int samples_size = frame.nb_samples *
|
||||||
handle->audio.codec->channels,
|
handle->audio.codec->channels *
|
||||||
frame.nb_samples,
|
sizeof(int16_t);
|
||||||
handle->audio.codec->sample_fmt, 1);
|
|
||||||
|
|
||||||
avcodec_fill_audio_frame(&frame, handle->audio.codec->channels,
|
avcodec_fill_audio_frame(&frame, handle->audio.codec->channels,
|
||||||
handle->audio.codec->sample_fmt, (const uint8_t*)handle->audio.buffer,
|
handle->audio.codec->sample_fmt, (const uint8_t*)handle->audio.buffer,
|
||||||
|
|
Loading…
Reference in New Issue