mirror of https://github.com/mgba-emu/mgba.git
Video: Fix uncompressed PCM audio recording
This commit is contained in:
parent
fc550c792e
commit
7279ba54f7
1
CHANGES
1
CHANGES
|
@ -14,6 +14,7 @@ Bugfixes:
|
||||||
- GBA Audio: Make larger buffer sizes than 2048 actually work properly
|
- GBA Audio: Make larger buffer sizes than 2048 actually work properly
|
||||||
- GBA Video: Fix blend issues with obscured middle layers
|
- GBA Video: Fix blend issues with obscured middle layers
|
||||||
- Video: Ensure FFmpeg encoder has audio frames
|
- Video: Ensure FFmpeg encoder has audio frames
|
||||||
|
- Video: Fix uncompressed PCM audio recording
|
||||||
Misc:
|
Misc:
|
||||||
- Qt: Disable sync to video by default
|
- Qt: Disable sync to video by default
|
||||||
- GBA: Exit cleanly on FATAL if the port supports it
|
- GBA: Exit cleanly on FATAL if the port supports it
|
||||||
|
|
|
@ -226,7 +226,7 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
|
||||||
encoder->audioFrame = avcodec_alloc_frame();
|
encoder->audioFrame = avcodec_alloc_frame();
|
||||||
#endif
|
#endif
|
||||||
if (!encoder->audio->frame_size) {
|
if (!encoder->audio->frame_size) {
|
||||||
encoder->audio->frame_size = 1024;
|
encoder->audio->frame_size = 1;
|
||||||
}
|
}
|
||||||
encoder->audioFrame->nb_samples = encoder->audio->frame_size;
|
encoder->audioFrame->nb_samples = encoder->audio->frame_size;
|
||||||
encoder->audioFrame->format = encoder->audio->sample_fmt;
|
encoder->audioFrame->format = encoder->audio->sample_fmt;
|
||||||
|
@ -368,9 +368,9 @@ void _ffmpegPostAudioFrame(struct GBAAVStream* stream, int32_t left, int32_t rig
|
||||||
|
|
||||||
int channelSize = 2 * av_get_bytes_per_sample(encoder->audio->sample_fmt);
|
int channelSize = 2 * av_get_bytes_per_sample(encoder->audio->sample_fmt);
|
||||||
avresample_convert(encoder->resampleContext,
|
avresample_convert(encoder->resampleContext,
|
||||||
0, 0, encoder->postaudioBufferSize / channelSize,
|
0, 0, 0,
|
||||||
(uint8_t**) &encoder->audioBuffer, 0, encoder->audioBufferSize / 4);
|
(uint8_t**) &encoder->audioBuffer, 0, encoder->audioBufferSize / 4);
|
||||||
if ((ssize_t) avresample_available(encoder->resampleContext) < (ssize_t) encoder->postaudioBufferSize / channelSize) {
|
if (avresample_available(encoder->resampleContext) < encoder->audioFrame->nb_samples) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if LIBAVCODEC_VERSION_MAJOR >= 55
|
#if LIBAVCODEC_VERSION_MAJOR >= 55
|
||||||
|
|
Loading…
Reference in New Issue