From a1a030a130240c2c33627a722b7abb89a2543a95 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Tue, 24 Feb 2026 00:07:09 +0100 Subject: [PATCH] fix: create render context before file load --- linux/runner/mpv/mpv_plugin.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linux/runner/mpv/mpv_plugin.cc b/linux/runner/mpv/mpv_plugin.cc index 71683dc6..cb152d01 100644 --- a/linux/runner/mpv/mpv_plugin.cc +++ b/linux/runner/mpv/mpv_plugin.cc @@ -139,6 +139,11 @@ static void mpv_plugin_handle_method_call(FlMethodChannel* channel, fl_texture_registrar_register_texture( self->texture_registrar, FL_TEXTURE(self->texture)); + // Create the render context eagerly — mpv needs it BEFORE any + // file is loaded, otherwise VO init fails with "No render context + // set" and the video track is dropped entirely. + self->player->InitRenderContext(); + // Set redraw callback: when mpv has a frame, mark texture available MpvTexture* tex = self->texture; self->player->SetRedrawCallback([tex]() {