diff options
author | wm4 <wm4@nowhere> | 2013-11-26 01:11:33 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-26 01:11:33 +0100 |
commit | bdd00d8b65b7cc6ec9c2084aeb56c98b81787f81 (patch) | |
tree | dfd8def109810abc7da4ed759fea6459a326b804 /mpvcore/player | |
parent | fe73b14eb1e8ccfc49dc73e1dbeb6510ed1e9452 (diff) | |
download | mpv-bdd00d8b65b7cc6ec9c2084aeb56c98b81787f81.tar.bz2 mpv-bdd00d8b65b7cc6ec9c2084aeb56c98b81787f81.tar.xz |
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.
Diffstat (limited to 'mpvcore/player')
-rw-r--r-- | mpvcore/player/video.c | 5 |
1 files changed, 1 insertions, 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) |