From 2646874369b0c5beb2aa2d443734745a19ad4d6c Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 18 Jul 2014 15:11:21 +0200 Subject: video: use symbolic constants instead of magic integers In my opinion this is not really necessary, since there's only a single user of update_video(), but others reading this code would probably hate me for using magic integer values instead of symbolic constants. This should be a purely cosmetic commit; any changes in behavior are bugs. --- player/playloop.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'player/playloop.c') diff --git a/player/playloop.c b/player/playloop.c index a3fcf133e3..c18c1cb5ce 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -970,7 +970,7 @@ void run_playloop(struct MPContext *mpctx) break; } - if (r == 0) { + if (r == VD_EOF) { if (!mpctx->playing_last_frame && mpctx->last_frame_duration > 0) { mpctx->time_frame += mpctx->last_frame_duration; mpctx->last_frame_duration = 0; @@ -978,23 +978,23 @@ void run_playloop(struct MPContext *mpctx) MP_VERBOSE(mpctx, "showing last frame\n"); } if (mpctx->playing_last_frame) { - r = 1; // don't stop playback yet + r = VD_PROGRESS; // don't stop playback yet MP_TRACE(mpctx, "still showing last frame\n"); } } video_left = r > 0; - if (r == 3) + if (r == VD_WAIT) break; if (mpctx->restart_playback) mpctx->sleeptime = 0; - if (r == 2) + if (r == VD_NEW_FRAME) MP_TRACE(mpctx, "frametime=%5.3f\n", frame_time); - if (r == 2 && !mpctx->restart_playback) { + if (r == VD_NEW_FRAME && !mpctx->restart_playback) { mpctx->time_frame += frame_time / opts->playback_speed; adjust_sync(mpctx, frame_time); } @@ -1010,7 +1010,7 @@ void run_playloop(struct MPContext *mpctx) break; } - if (r != 2 && !mpctx->playing_last_frame) { + if (r != VD_NEW_FRAME && !mpctx->playing_last_frame) { mpctx->sleeptime = 0; break; } @@ -1060,7 +1060,7 @@ void run_playloop(struct MPContext *mpctx) mpctx->playing_last_frame = false; // last frame case (don't set video_left - consider format changes) - if (r != 2) + if (r != VD_NEW_FRAME) break; //=================== FLIP PAGE (VIDEO BLT): ====================== -- cgit v1.2.3