summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-07-07 16:10:53 +0200
committerwm4 <wm4@nowhere>2016-07-07 16:10:53 +0200
commitf2110f582d0432d59f743565e75c0a16ef1f8668 (patch)
tree9ab07ae9c65f3b19819d813e6e985a42d1928c30
parent8660b4c9f08d2cfab9e3a72330d68597777827bb (diff)
downloadmpv-f2110f582d0432d59f743565e75c0a16ef1f8668.tar.bz2
mpv-f2110f582d0432d59f743565e75c0a16ef1f8668.tar.xz
vo_vdpau: minor simplification
Remove some indirections that aren't needed anymore.
-rw-r--r--video/out/vo_vdpau.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 75069b0666..6dd31e9082 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -141,18 +141,17 @@ struct vdpctx {
};
static bool status_ok(struct vo *vo);
-static void draw_osd(struct vo *vo);
-static int render_video_to_output_surface(struct vo *vo,
- VdpOutputSurface output_surface,
- VdpRect *output_rect,
- VdpRect *video_rect)
+static int video_to_output_surface(struct vo *vo, struct mp_image *mpi)
{
struct vdpctx *vc = vo->priv;
struct vdp_functions *vdp = vc->vdp;
VdpTime dummy;
VdpStatus vdp_st;
- struct mp_image *mpi = vc->current_image;
+
+ VdpOutputSurface output_surface = vc->output_surfaces[vc->surface_num];
+ VdpRect *output_rect = &vc->out_rect_vid;
+ VdpRect *video_rect = &vc->src_rect_vid;
vdp_st = vdp->presentation_queue_block_until_surface_idle(vc->flip_queue,
output_surface,
@@ -235,17 +234,6 @@ static int render_video_to_output_surface(struct vo *vo,
return 0;
}
-static int video_to_output_surface(struct vo *vo)
-{
- struct vdpctx *vc = vo->priv;
-
- int r = render_video_to_output_surface(vo,
- vc->output_surfaces[vc->surface_num],
- &vc->out_rect_vid, &vc->src_rect_vid);
- draw_osd(vo);
- return r;
-}
-
static void forget_frames(struct vo *vo, bool seek_reset)
{
struct vdpctx *vc = vo->priv;
@@ -899,8 +887,10 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
vc->current_pts = frame->pts;
vc->current_duration = frame->duration;
- if (status_ok(vo))
- video_to_output_surface(vo);
+ if (status_ok(vo)) {
+ video_to_output_surface(vo, vc->current_image);
+ draw_osd(vo);
+ }
}
// warning: the size and pixel format of surface must match that of the