Skip to main content

## MPV_HANDLE

# Static MPV_HANDLE

Source

    static MPV_HANDLE: OnceLock<usize>

Expand description

The mpv handle of the backend this process created, for the video surface.

A `OnceLock` rather than a field reached through `PlayerBackend`, because the trait is cross-platform and a raw mpv pointer is not something every backend should have to pretend to have. Stored as `usize` because a raw pointer is neither `Send` nor `Sync`; the only consumer is the GTK main thread, which is also where mpv was created.

Written once at construction and never cleared: the backend outlives the window, so there is no window in which this could dangle while a surface is still using it.

TRACES: UR-080 | DR-231