summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Kurczewski <mkurczew@gmail.com>2015-04-21 11:50:44 +0200
committerwm4 <wm4@nowhere>2015-04-21 11:54:14 +0200
commitdedb15a42927f3ac4add91856b9e8696b1fa4fb1 (patch)
tree724e2cd2a575c2cbd21ea9e34e28b544c84bacd4
parent7f29172baf7a4ae57eb5af3e3ccd667553aa73f8 (diff)
downloadmpv-dedb15a42927f3ac4add91856b9e8696b1fa4fb1.tar.bz2
mpv-dedb15a42927f3ac4add91856b9e8696b1fa4fb1.tar.xz
vo_drm: fix coding style to adhere to guidelines
-rw-r--r--video/out/drm_common.c6
-rw-r--r--video/out/vo_drm.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/video/out/drm_common.c b/video/out/drm_common.c
index cbb0f0182a..c61ad69eba 100644
--- a/video/out/drm_common.c
+++ b/video/out/drm_common.c
@@ -119,14 +119,12 @@ void vt_switcher_poll(struct vt_switcher *s, int timeout_ms)
{ .events = POLLIN, .fd = vt_switcher_pipe[0] },
};
poll(fds, 1, timeout_ms);
- if (!fds[0].revents) {
+ if (!fds[0].revents)
return;
- }
unsigned char event;
- if (read(fds[0].fd, &event, sizeof(event)) != sizeof(event)) {
+ if (read(fds[0].fd, &event, sizeof(event)) != sizeof(event))
return;
- }
switch (event) {
case EVT_RELEASE:
diff --git a/video/out/vo_drm.c b/video/out/vo_drm.c
index 1c05b24008..0d861fa6f8 100644
--- a/video/out/vo_drm.c
+++ b/video/out/vo_drm.c
@@ -350,7 +350,8 @@ static void modeset_page_flipped(int fd, unsigned int frame, unsigned int sec,
static int setup_vo_crtc(struct vo *vo)
{
struct priv *p = vo->priv;
- if (p->active) return;
+ if (p->active)
+ return;
p->old_crtc = drmModeGetCrtc(p->fd, p->dev->crtc);
int ret = drmModeSetCrtc(p->fd, p->dev->crtc,
p->dev->bufs[p->dev->front_buf + BUF_COUNT - 1].fb,
@@ -363,7 +364,8 @@ static void release_vo_crtc(struct vo *vo)
{
struct priv *p = vo->priv;
- if (!p->active) return;
+ if (!p->active)
+ return;
p->active = false;
// wait for current page flip
@@ -511,8 +513,8 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
static void flip_page(struct vo *vo)
{
struct priv *p = vo->priv;
- if (!p->active) return;
- if (p->pflip_happening) return;
+ if (!p->active || p->pflip_happening)
+ return;
int ret = drmModePageFlip(p->fd, p->dev->crtc,
p->dev->bufs[p->dev->front_buf].fb,