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