]> git.sesse.net Git - mlt/commitdiff
When doing glReadPixels(), make sure we read from the right FBO.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 31 Dec 2013 12:27:28 +0000 (13:27 +0100)
committerDan Dennedy <dan@dennedy.org>
Tue, 31 Dec 2013 20:13:39 +0000 (12:13 -0800)
Newer versions of Movit clear the FBO attachment after rendering to an FBO
(so that it's harder to accidentally attach to the same FBO from multiple
threads), so we need to explicitly choose one to read from.

src/modules/opengl/filter_glsl_manager.cpp

index cd479b74a492b5c0ca2aec39fc62fd95ec225710..468e3b0422ef409facf577eadf5357a0f4e000c7 100644 (file)
@@ -422,6 +422,8 @@ int GlslManager::render_frame_rgba(mlt_service service, mlt_frame frame, int wid
        render_fbo( service, chain, fbo->fbo, width, height );
 
        // Read FBO into PBO
+       glBindFramebuffer( GL_FRAMEBUFFER, fbo->fbo );
+       check_error();
        glBindBuffer( GL_PIXEL_PACK_BUFFER_ARB, pbo->pbo );
        check_error();
        glBufferData( GL_PIXEL_PACK_BUFFER_ARB, img_size, NULL, GL_STREAM_READ );