Since “2d924b3a63 fftools/ffmpeg: move each muxer to a separate thread”, opengl_write_packet() is called from a different thread than opengl_write_header() and would nothing for lack of a selected context.