mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-14 07:23:58 +00:00
@@ -142,7 +142,8 @@ public:
|
||||
if ((r = avcodec_send_packet(avc, pkt)) >= 0) {
|
||||
int rem_output_bytes = int(output_data_size);
|
||||
av_frame_unref(frame);
|
||||
while ((r = avcodec_receive_frame(avc, frame)) >= 0) {
|
||||
do {
|
||||
r = avcodec_receive_frame(avc, frame);
|
||||
auto const input_bsize = av_samples_get_buffer_size(frame->linesize, frame->ch_layout.nb_channels, frame->nb_samples, AV_SAMPLE_FMT_S16, 1);
|
||||
ASSERT(rem_output_bytes - input_bsize >= 0);
|
||||
auto const dst_data = reinterpret_cast<s16*>(output_data + (int(output_data_size) - rem_output_bytes));
|
||||
@@ -162,10 +163,12 @@ public:
|
||||
out_sample_count += frame->nb_samples;
|
||||
rem_output_bytes -= input_bsize;
|
||||
av_frame_unref(frame);
|
||||
}
|
||||
if (r == AVERROR_EOF) {
|
||||
LOG_WARNING(Audio_DSP, "eof");
|
||||
} while (r >= 0 && rem_output_bytes > 0);
|
||||
if (r == AVERROR(EAGAIN) || r == AVERROR_EOF) {
|
||||
// non-errors
|
||||
LOG_DEBUG(Audio_DSP, "{}", r);
|
||||
} else if (r < 0) {
|
||||
// errors
|
||||
LOG_ERROR(Audio_DSP, "{}", r);
|
||||
}
|
||||
ASSERT(rem_output_bytes == 0 && "remaining bytes!");
|
||||
|
||||
Reference in New Issue
Block a user