all repos — mgba @ 9edf42b4545b4b43b625edda8a75b0cfcc22b3d6

mGBA Game Boy Advance Emulator

Video: Fix uncompressed PCM audio recording
Jeffrey Pfau jeffrey@endrift.com
Wed, 24 Dec 2014 00:06:26 -0800
commit

9edf42b4545b4b43b625edda8a75b0cfcc22b3d6

parent

6656f53f61a24d2122473027ffb7f6c74ac8d851

2 files changed, 4 insertions(+), 3 deletions(-)

jump to
M CHANGESCHANGES

@@ -26,6 +26,7 @@ - GBA Audio: Make larger buffer sizes than 2048 actually work properly

- GBA Audio: Audio buffer sizes are now correct sizes for both sample rates - GBA Video: Fix blend issues with obscured middle layers - Video: Ensure FFmpeg encoder has audio frames + - Video: Fix uncompressed PCM audio recording Misc: - Qt: Disable sync to video by default - GBA: Exit cleanly on FATAL if the port supports it
M src/platform/ffmpeg/ffmpeg-encoder.csrc/platform/ffmpeg/ffmpeg-encoder.c

@@ -226,7 +226,7 @@ #else

encoder->audioFrame = avcodec_alloc_frame(); #endif 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->format = encoder->audio->sample_fmt;

@@ -368,9 +368,9 @@ encoder->currentAudioSample = 0;

int channelSize = 2 * av_get_bytes_per_sample(encoder->audio->sample_fmt); avresample_convert(encoder->resampleContext, - 0, 0, encoder->postaudioBufferSize / channelSize, + 0, 0, 0, (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; } #if LIBAVCODEC_VERSION_MAJOR >= 55