1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-18 04:45:33 +00:00

video: actually count decoder-dropped frames

Normally, feeding a packet to the decoder should always return a frame
_if_ we received a frame before. So while we can't know exactly whether
a frame was dropped, at least the normal case is easily detectable.

This means we display something closer to the actual framedrop count,
instead of a bad guess.
This commit is contained in:
wm4 2014-09-19 23:57:48 +02:00
parent 4047e7e6cb
commit 771583c285

View File

@ -344,11 +344,7 @@ static int check_framedrop(struct MPContext *mpctx)
// we should avoid dropping too many frames in sequence unless we
// are too late. and we allow 100ms A-V delay here:
if (mpctx->last_av_difference - 0.100 > mpctx->dropped_frames * frame_time)
{
mpctx->drop_frame_cnt++;
mpctx->dropped_frames++;
return !!(opts->frame_dropping & 2);
}
}
return 0;
}
@ -384,6 +380,13 @@ static int decode_image(struct MPContext *mpctx)
bool had_packet = !!pkt;
talloc_free(pkt);
if (had_packet && !d_video->waiting_decoded_mpi &&
mpctx->video_status == STATUS_PLAYING)
{
mpctx->drop_frame_cnt++;
mpctx->dropped_frames++;
}
return had_packet ? VD_PROGRESS : VD_EOF;
}