Mir

Comment 1 for bug 1280086

Revision history for this message
Alberto Aguirre (albaguirre) wrote : Re: mir screencast utility crashes on android devices

There is a subtle threading issue happening. For some unkown reason, the EGL context goes bad after waiting on a future in the main thread - the EGL context was made current in the main thread and should remain so.

Possibly a TLS issue.

....
 while (running)
    {
        //EGL context is good here - all gl calls made here work fine.
        frame_written_future.wait();
        //EGL context is not valid here anymore all gl calls fail after this wait
        auto format = read_pixels(frame_size, frame_data.data());
        frame_written_future = write_frame_to_file(frame_data, frame_number, format);

        egl_setup.swap_buffers();
        ++frame_number;
    }