1
mirror of https://github.com/mpv-player/mpv synced 2024-11-14 22:48:35 +01:00

player/video: avoid spamming logs with EOF

When playing a sparse video stream, the debug log gets hit with the
video EOF constantly since the audio is still playing. There's no
practical use for this so just do add some logic to only signal it once
if it is sparse.
This commit is contained in:
Dudemanguy 2023-08-10 11:31:56 -05:00
parent 41c0321208
commit fccb4466cd
2 changed files with 6 additions and 1 deletions

View File

@ -168,6 +168,7 @@ struct vo_chain {
bool is_coverart; bool is_coverart;
// - video consists of sparse still images // - video consists of sparse still images
bool is_sparse; bool is_sparse;
bool sparse_eof_signalled;
bool underrun; bool underrun;
bool underrun_signaled; bool underrun_signaled;

View File

@ -1097,7 +1097,11 @@ void write_video(struct MPContext *mpctx)
} }
} }
MP_DBG(mpctx, "video EOF (status=%d)\n", mpctx->video_status); // Avoid pointlessly spamming the logs every frame.
if (!vo_c->is_sparse || !vo_c->sparse_eof_signalled) {
MP_DBG(mpctx, "video EOF (status=%d)\n", mpctx->video_status);
vo_c->sparse_eof_signalled = vo_c->is_sparse;
}
return; return;
} }