diff options
author | wm4 <wm4@nowhere> | 2014-06-18 15:55:01 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-06-18 15:55:01 +0200 |
commit | 504f67a7596a8beab6240b52d80f3d9f3dbf1750 (patch) | |
tree | 830f37c93a8ffdce745238986868d3afa2a65016 | |
parent | af6ecb02566f3e24ac114b515d664372098326cf (diff) | |
download | mpv-504f67a7596a8beab6240b52d80f3d9f3dbf1750.tar.bz2 mpv-504f67a7596a8beab6240b52d80f3d9f3dbf1750.tar.xz |
vo_opengl: fix regression with opengl:pbo
In the pbo case, mpi was reassigned to a stack pointer, and later
deallocated. Just change the code so it doesn't need to be reassigned.
-rw-r--r-- | video/out/gl_video.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c index b04fa97500..7306d33ae6 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -1742,13 +1742,12 @@ void gl_video_upload_image(struct gl_video *p, struct mp_image *mpi) memcpy_pic(mpi2.planes[n], mpi->planes[n], line_bytes, mpi->plane_h[n], mpi2.stride[n], mpi->stride[n]); } - mpi = &mpi2; pbo = true; } - vimg->image_flipped = mpi->stride[0] < 0; + vimg->image_flipped = mpi2.stride[0] < 0; for (int n = 0; n < p->plane_count; n++) { struct texplane *plane = &vimg->planes[n]; - void *plane_ptr = mpi->planes[n]; + void *plane_ptr = mpi2.planes[n]; if (pbo) { gl->BindBuffer(GL_PIXEL_UNPACK_BUFFER, plane->gl_buffer); if (!gl->UnmapBuffer(GL_PIXEL_UNPACK_BUFFER)) @@ -1760,7 +1759,7 @@ void gl_video_upload_image(struct gl_video *p, struct mp_image *mpi) gl->ActiveTexture(GL_TEXTURE0 + n); gl->BindTexture(p->gl_target, plane->gl_texture); glUploadTex(gl, p->gl_target, plane->gl_format, plane->gl_type, - plane_ptr, mpi->stride[n], 0, 0, plane->w, plane->h, 0); + plane_ptr, mpi2.stride[n], 0, 0, plane->w, plane->h, 0); } gl->ActiveTexture(GL_TEXTURE0); gl->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); |