chore(mpv): share desktop startup options and stop forwarding unused Android events

Linux and Windows each wrote the same eleven pre-initialize mpv options
(keep-open, idle, input disabling, OSC, ytdl, audio fallback, and the
audio-only set); ApplyCommonStartupOptions in mpv_player_common.h owns
them once, with the ytdl security rationale kept in one place. Rendering,
windowing, HDR, and log-level options stay per platform.

The Android JNI event thread forwarded every mpv event to Kotlin, where
MpvEvent modelled ten variants but MpvPlayerCore consumes four. The
native switch now forwards only START_FILE, FILE_LOADED, and
PLAYBACK_RESTART (END_FILE keeps its own path), and the unused variants
are gone.
This commit is contained in:
edde746
2026-09-03 11:36:29 +02:00
parent b27cab4510
commit d181bd34ae
6 changed files with 46 additions and 68 deletions
+6 -1
View File
@@ -81,10 +81,15 @@ void* event_thread(void* arg) {
case MPV_EVENT_END_FILE:
sendEndFileToJava(env, mp_event);
break;
default:
case MPV_EVENT_START_FILE:
case MPV_EVENT_FILE_LOADED:
case MPV_EVENT_PLAYBACK_RESTART:
ALOGV("event: %s\n", mpv_event_name(mp_event->event_id));
sendEventToJava(env, mp_event->event_id);
break;
default:
// Nothing on the Kotlin side consumes the remaining ids (MpvEvent.fromId).
break;
}
}