mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 12:02:23 +02:00
vaapi: fix va_surface_get_uncropped_size() for libavutil surfaces
Fixes vf_vavpp crashing with the new vaapi decode API.
This commit is contained in:
parent
a38283d5d9
commit
398e2d5d42
@ -296,9 +296,15 @@ int va_surface_rt_format(struct mp_image *mpi)
|
||||
// padded surfaces for example.)
|
||||
void va_surface_get_uncropped_size(struct mp_image *mpi, int *out_w, int *out_h)
|
||||
{
|
||||
struct va_surface *s = va_surface_in_mp_image(mpi);
|
||||
*out_w = s ? s->w : 0;
|
||||
*out_h = s ? s->h : 0;
|
||||
if (mpi->hwctx) {
|
||||
AVHWFramesContext *fctx = (void *)mpi->hwctx->data;
|
||||
*out_w = fctx->width;
|
||||
*out_h = fctx->height;
|
||||
} else {
|
||||
struct va_surface *s = va_surface_in_mp_image(mpi);
|
||||
*out_w = s ? s->w : 0;
|
||||
*out_h = s ? s->h : 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void release_va_surface(void *arg)
|
||||
|
Loading…
Reference in New Issue
Block a user