From bdd00d8b65b7cc6ec9c2084aeb56c98b81787f81 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 26 Nov 2013 01:11:33 +0100 Subject: player: don't use a loop when no loop is needed This used a really weird idiom: a loop that iterates only once, so you can use break; to jump out of the block. --- mpvcore/player/video.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mpvcore/player/video.c b/mpvcore/player/video.c index 65fc81d92c..429e141ab9 100644 --- a/mpvcore/player/video.c +++ b/mpvcore/player/video.c @@ -292,9 +292,7 @@ double update_video(struct MPContext *mpctx, double endpts) if (d_video->header->attached_picture) return update_video_attached_pic(mpctx); - while (1) { - if (load_next_vo_frame(mpctx, false)) - break; + if (!load_next_vo_frame(mpctx, false)) { struct demux_packet *pkt = demux_read_packet(d_video->header); if (pkt && pkt->pts != MP_NOPTS_VALUE) pkt->pts += mpctx->video_offset; @@ -311,7 +309,6 @@ double update_video(struct MPContext *mpctx, double endpts) if (!load_next_vo_frame(mpctx, true)) return -1; } - break; } if (!video_out->frame_loaded) -- cgit v1.2.3