vo_wayland: remove unnecessary check

buffer_pool_get_front now returns always a valid buffer.
No need for corner cases.
This commit is contained in:
Alexander Preisinger 2014-09-16 15:54:10 +02:00
parent 20643b6c91
commit 95053ba78b
1 changed files with 10 additions and 19 deletions

View File

@ -373,28 +373,19 @@ static void frame_handle_redraw(void *data,
struct vo_wayland_state *wl = p->wl;
shm_buffer_t *buf = buffer_pool_get_front(&p->video_bufpool);
if (buf) {
wl_surface_attach(wl->window.video_surface, buf->buffer, p->x, p->y);
wl_surface_damage(wl->window.video_surface, 0, 0, p->dst_w, p->dst_h);
wl_surface_attach(wl->window.video_surface, buf->buffer, p->x, p->y);
wl_surface_damage(wl->window.video_surface, 0, 0, p->dst_w, p->dst_h);
if (callback)
wl_callback_destroy(callback);
if (callback)
wl_callback_destroy(callback);
p->redraw_callback = wl_surface_frame(wl->window.video_surface);
wl_callback_add_listener(p->redraw_callback, &frame_listener, p);
wl_surface_commit(wl->window.video_surface);
buffer_finalise_front(buf);
p->redraw_callback = wl_surface_frame(wl->window.video_surface);
wl_callback_add_listener(p->redraw_callback, &frame_listener, p);
wl_surface_commit(wl->window.video_surface);
buffer_finalise_front(buf);
p->x = 0;
p->y = 0;
}
else {
MP_WARN(wl, "Should not happen anymore (frame)\n");
if (callback)
wl_callback_destroy(callback);
p->redraw_callback = NULL;
}
p->x = 0;
p->y = 0;
p->recent_flip_time = mp_time_us();
}