mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-15 13:52:28 +00:00
Quiet down log spam for asynchronous decoders
This commit is contained in:
parent
80128e8293
commit
9999ded933
1 changed files with 8 additions and 4 deletions
|
@ -1047,10 +1047,14 @@ int FFmpegVideoDecoder::submitDecodeUnit(PDECODE_UNIT du)
|
||||||
// limited number of "failed decodes" with EAGAIN are expected for asynchronous
|
// limited number of "failed decodes" with EAGAIN are expected for asynchronous
|
||||||
// decoders, so we only reset the decoder if we get a ton of them in a row.
|
// decoders, so we only reset the decoder if we get a ton of them in a row.
|
||||||
if (!submittedFrame || err != AVERROR(EAGAIN)) {
|
if (!submittedFrame || err != AVERROR(EAGAIN)) {
|
||||||
char errorstring[512];
|
// Don't spam EAGAIN log messages for asynchronous decoders as long as
|
||||||
av_strerror(err, errorstring, sizeof(errorstring));
|
// they produce a frame for at least every other submitted packet.
|
||||||
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
if (m_ConsecutiveFailedDecodes > 0 || err != AVERROR(EAGAIN)) {
|
||||||
"avcodec_receive_frame() failed: %s", errorstring);
|
char errorstring[512];
|
||||||
|
av_strerror(err, errorstring, sizeof(errorstring));
|
||||||
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"avcodec_receive_frame() failed: %s", errorstring);
|
||||||
|
}
|
||||||
|
|
||||||
if (++m_ConsecutiveFailedDecodes == FAILED_DECODES_RESET_THRESHOLD) {
|
if (++m_ConsecutiveFailedDecodes == FAILED_DECODES_RESET_THRESHOLD) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
|
Loading…
Reference in a new issue