summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-19 23:57:48 +0200
committerwm4 <wm4@nowhere>2014-09-20 00:45:39 +0200
commit771583c285fd2d7da2d739fdcdfe5cb15624f6b8 (patch)
tree2dd465231be37b0f337bca8a963d4d31b1aedcb8 /player
parent4047e7e6cb8db776dd771d1dd6ef0b58f20e063a (diff)
downloadmpv-771583c285fd2d7da2d739fdcdfe5cb15624f6b8.tar.bz2
mpv-771583c285fd2d7da2d739fdcdfe5cb15624f6b8.tar.xz
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.
Diffstat (limited to 'player')
-rw-r--r--player/video.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/player/video.c b/player/video.c
index 3332aca737..61cbb09713 100644
--- a/player/video.c
+++ b/player/video.c
@@ -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;
}