[APU] Fix ffmpeg upgrade related logspam
This commit is contained in:
@@ -26,6 +26,7 @@ extern "C" {
|
||||
#endif
|
||||
#include "third_party/FFmpeg/libavcodec/avcodec.h"
|
||||
#include "third_party/FFmpeg/libavutil/channel_layout.h"
|
||||
#include "third_party/FFmpeg/libavutil/error.h"
|
||||
#if XE_COMPILER_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
@@ -577,16 +578,15 @@ void XmaContextMaster::Decode(XMA_CONTEXT_DATA* data) {
|
||||
assert_always();
|
||||
}
|
||||
ret = avcodec_receive_frame(av_context_, av_frame_);
|
||||
/*
|
||||
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
|
||||
// TODO AVERROR_EOF???
|
||||
break;
|
||||
else
|
||||
*/
|
||||
if (ret == AVERROR(EAGAIN)) {
|
||||
return;
|
||||
}
|
||||
if (ret < 0) {
|
||||
XELOGE("XmaContext {}: Error during decoding", id());
|
||||
assert_always();
|
||||
return; // TODO bail out
|
||||
char errbuf[AV_ERROR_MAX_STRING_SIZE];
|
||||
av_strerror(ret, errbuf, sizeof(errbuf));
|
||||
XELOGE("XmaContext {}: Error during decoding: {} ({})", id(), errbuf,
|
||||
ret);
|
||||
return;
|
||||
}
|
||||
assert_true(ret == 0);
|
||||
|
||||
@@ -831,6 +831,7 @@ int XmaContextMaster::PrepareDecoder(uint8_t* packet, int sample_rate,
|
||||
|
||||
av_context_->sample_rate = sample_rate;
|
||||
av_channel_layout_default(&av_context_->ch_layout, channels);
|
||||
av_context_->flags2 |= AV_CODEC_FLAG2_SKIP_MANUAL;
|
||||
|
||||
if (avcodec_open2(av_context_, av_codec_, NULL) < 0) {
|
||||
XELOGE("XmaContext: Failed to reopen FFmpeg context");
|
||||
|
||||
Reference in New Issue
Block a user