aboutsummaryrefslogtreecommitdiffhomepage
path: root/libvo
diff options
context:
space:
mode:
authorGravatar Uoti Urpala <uau@mplayer2.org>2011-08-11 21:13:34 +0300
committerGravatar Uoti Urpala <uau@mplayer2.org>2011-08-11 21:46:27 +0300
commite30416c9979232bf86cb58992421e66e03eda492 (patch)
treec79f990dd895f3785c100e4ae4d809f694ec56aa /libvo
parent2a30588258a7c0bf15d5d20b614aa6f96a256e19 (diff)
vo_vpdau: fix preemption recovery broken in decec7f2a37e559d
Commit decec7f2a3 ("vo_vdpau: skip resize code if not fully initialized") broke preemption recovery because the resize code stayed incorrectly disabled when it would have been used to reinitialize things during recovery. Revert that commit and add different checks to avoid running various code when not in a fully functional state.
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_vdpau.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/libvo/vo_vdpau.c b/libvo/vo_vdpau.c
index 6fb32b442b..f487b3b2a3 100644
--- a/libvo/vo_vdpau.c
+++ b/libvo/vo_vdpau.c
@@ -371,10 +371,6 @@ static void resize(struct vo *vo)
struct vdp_functions *vdp = vc->vdp;
VdpStatus vdp_st;
int i;
-
- if (!vo->config_ok || vc->is_preempted)
- return;
-
struct vo_rect src_rect;
struct vo_rect dst_rect;
struct vo_rect borders;
@@ -935,7 +931,6 @@ static int config(struct vo *vo, uint32_t width, uint32_t height,
if ((flags & VOFLAG_FULLSCREEN) && WinID <= 0)
vo_fs = 1;
- vo->config_ok = true; // set temporarily as resize() checks it below
if (initialize_vdpau_objects(vo) < 0)
return -1;
@@ -1707,6 +1702,13 @@ static int get_equalizer(struct vo *vo, const char *name, int *value)
return VO_TRUE;
}
+static bool status_ok(struct vo *vo)
+{
+ if (!vo->config_ok || handle_preemption(vo) < 0)
+ return false;
+ return true;
+}
+
static int set_equalizer(struct vo *vo, const char *name, int value)
{
struct vdpctx *vc = vo->priv;
@@ -1722,10 +1724,18 @@ static int set_equalizer(struct vo *vo, const char *name, int value)
else
return VO_NOTIMPL;
- update_csc_matrix(vo);
+ if (status_ok(vo))
+ update_csc_matrix(vo);
return true;
}
+static void checked_resize(struct vo *vo)
+{
+ if (!status_ok(vo))
+ return;
+ resize(vo);
+}
+
static int control(struct vo *vo, uint32_t request, void *data)
{
struct vdpctx *vc = vo->priv;
@@ -1741,7 +1751,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
vc->deint = *(int *)data;
if (vc->deint)
vc->deint = vc->deint_type;
- if (vc->deint_type > 2) {
+ if (vc->deint_type > 2 && status_ok(vo)) {
VdpStatus vdp_st;
VdpVideoMixerFeature features[1] =
{vc->deint_type == 3 ?
@@ -1768,16 +1778,16 @@ static int control(struct vo *vo, uint32_t request, void *data)
abort(); // draw_image() should get called directly
case VOCTRL_BORDER:
vo_x11_border(vo);
- resize(vo);
+ checked_resize(vo);
return VO_TRUE;
case VOCTRL_FULLSCREEN:
vo_x11_fullscreen(vo);
- resize(vo);
+ checked_resize(vo);
return VO_TRUE;
case VOCTRL_GET_PANSCAN:
return VO_TRUE;
case VOCTRL_SET_PANSCAN:
- resize(vo);
+ checked_resize(vo);
return VO_TRUE;
case VOCTRL_SET_EQUALIZER: {
struct voctrl_set_equalizer_args *args = data;
@@ -1789,7 +1799,8 @@ static int control(struct vo *vo, uint32_t request, void *data)
}
case VOCTRL_SET_YUV_COLORSPACE:
vc->colorspace = *(int *)data % 3;
- update_csc_matrix(vo);
+ if (status_ok(vo))
+ update_csc_matrix(vo);
return true;
case VOCTRL_GET_YUV_COLORSPACE:
*(int *)data = vc->colorspace;