fix(mpv): harden native initialization and logging

This commit is contained in:
edde746
2026-07-12 08:42:23 +02:00
parent eaa60cc2b5
commit 3d36ecf094
5 changed files with 75 additions and 4 deletions
+8
View File
@@ -132,6 +132,14 @@ void MpvPlayerPlugin::HandleMethodCall(
const auto& method = method_call.method_name();
if (method == "initialize") {
// Method-channel calls are serialized on the platform thread. Keep an
// already-live core instead of replacing it (which would synchronously
// join its event thread before MpvPlayer::Initialize can see its guard).
if (player_ && player_->IsInitialized()) {
result->Success(flutter::EncodableValue(true));
return;
}
if (proc_id_) {
registrar_->UnregisterTopLevelWindowProcDelegate(proc_id_.value());
proc_id_ = std::nullopt;