1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-29 02:22:19 +00:00

vo_opengl: hwdec: reset hw_subfmt field

In theory, mp_image_params with hw_subfmt set to non-0 if imgfmt is not
a hwaccel format is invalid. (It worked fine because nothing checks this
yet.)
This commit is contained in:
wm4 2016-07-15 12:01:30 +02:00
parent 85488f6892
commit ae94f329a9
8 changed files with 9 additions and 0 deletions

View File

@ -255,6 +255,7 @@ static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
goto fail;
params->imgfmt = params->hw_subfmt;
params->hw_subfmt = 0;
for (int n = 0; n < num_planes; n++) {
gl->ActiveTexture(GL_TEXTURE0 + texunits + n);

View File

@ -190,6 +190,7 @@ static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
gl->BindTexture(GL_TEXTURE_2D, 0);
params->imgfmt = IMGFMT_RGB0;
params->hw_subfmt = 0;
return 0;
}

View File

@ -273,6 +273,7 @@ static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
gl->BindTexture(GL_TEXTURE_2D, 0);
params->imgfmt = IMGFMT_RGB0;
params->hw_subfmt = 0;
return 0;
fail:
destroy_textures(hw);

View File

@ -160,6 +160,7 @@ static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
}
params->imgfmt = SHARED_SURFACE_MPFMT;
params->hw_subfmt = 0;
return 0;
fail:

View File

@ -193,6 +193,7 @@ static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
}
params->imgfmt = f->imgfmt;
params->hw_subfmt = 0;
return 0;
}

View File

@ -262,6 +262,7 @@ static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
MP_VERBOSE(p, "hw format: %s\n", mp_imgfmt_to_name(p->current_mpfmt));
params->imgfmt = p->current_mpfmt;
params->hw_subfmt = 0;
return 0;
}

View File

@ -167,6 +167,7 @@ static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
gl->BindTexture(GL_TEXTURE_2D, 0);
params->imgfmt = IMGFMT_RGB0;
params->hw_subfmt = 0;
return 0;
}

View File

@ -173,6 +173,7 @@ static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
if (p->direct_mode) {
params->imgfmt = IMGFMT_NV12;
params->hw_subfmt = 0;
} else {
vdp_st = vdp->output_surface_create(p->ctx->vdp_device,
VDP_RGBA_FORMAT_B8G8R8A8,
@ -188,6 +189,7 @@ static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
gl->VDPAUSurfaceAccessNV(p->vdpgl_surface, GL_READ_ONLY);
params->imgfmt = IMGFMT_RGB0;
params->hw_subfmt = 0;
}
gl_check_error(gl, hw->log, "After initializing vdpau OpenGL interop");