Commit 7f569759 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vdpau/chroma: remove dead code and simplify

parent 05e98ecf
...@@ -292,24 +292,21 @@ static picture_t *OutputAllocate(filter_t *filter) ...@@ -292,24 +292,21 @@ static picture_t *OutputAllocate(filter_t *filter)
picture_sys_t *psys = pic->p_sys; picture_sys_t *psys = pic->p_sys;
assert(psys->vdp != NULL); assert(psys->vdp != NULL);
if (unlikely(sys->vdp != psys->vdp) && (sys->mixer != VDP_INVALID_HANDLE)) if (likely(sys->mixer != VDP_INVALID_HANDLE))
{ { /* Not the first output picture */
Flush(filter); /* release surfaces from the old device */ assert(psys->vdp == sys->vdp);
vdp_video_mixer_destroy(sys->vdp, sys->mixer); return pic;
vdp_release_x11(sys->vdp);
sys->mixer = VDP_INVALID_HANDLE;
} }
if (unlikely(sys->mixer == VDP_INVALID_HANDLE)) /* First picture: get the context and allocate the mixer */
{
sys->vdp = vdp_hold_x11(psys->vdp, NULL); sys->vdp = vdp_hold_x11(psys->vdp, NULL);
sys->device = psys->device; sys->device = psys->device;
sys->mixer = MixerCreate(filter); sys->mixer = MixerCreate(filter);
if (sys->mixer == VDP_INVALID_HANDLE) if (sys->mixer != VDP_INVALID_HANDLE)
goto error;
}
return pic; return pic;
error:
vdp_release_x11(psys->vdp);
psys->vdp = NULL;
picture_Release(pic); picture_Release(pic);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment