summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-03 15:29:48 +0200
committerwm4 <wm4@nowhere>2014-05-03 15:29:48 +0200
commitae4613cd3bdc93aed605483f8ce910c93408f683 (patch)
tree63ff7e9550dac2f5e2fa18be79a9470508cab757
parentc9ed70b66611d1c0e56a67a0a9bf385d7996f0f5 (diff)
downloadmpv-ae4613cd3bdc93aed605483f8ce910c93408f683.tar.bz2
mpv-ae4613cd3bdc93aed605483f8ce910c93408f683.tar.xz
video: fix video end condition
This wasn't really fine, and could (perhaps) cause weird corner cases on reinit or when the player was paused. Before eb9d20, video_left was also set to true if vo->frame_loaded was set, and this variable basically indicated whether the previous update_video() call was successful. This was overlooked when changing everything. Simply always call update_video(), it should be equivalent.
-rw-r--r--player/playloop.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/player/playloop.c b/player/playloop.c
index b97438400f..67da087475 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -983,12 +983,11 @@ void run_playloop(struct MPContext *mpctx)
struct vo *vo = mpctx->video_out;
update_fps(mpctx);
- int r = 1; // like update_video return value
- video_left = vo->hasframe || mpctx->playing_last_frame;
+ double frame_time = 0;
+ int r = update_video(mpctx, endpts, false, &frame_time);
+ MP_VERBOSE(mpctx, "update_video: %d\n", r);
+ video_left = r > 0 || vo->hasframe || mpctx->playing_last_frame;
if (!mpctx->paused || mpctx->restart_playback) {
- double frame_time = 0;
- r = update_video(mpctx, endpts, false, &frame_time);
- MP_VERBOSE(mpctx, "update_video: %d\n", r);
if (r == 0) {
if (!mpctx->playing_last_frame && mpctx->last_frame_duration > 0) {
mpctx->time_frame += mpctx->last_frame_duration;