mirror of
https://github.com/mpv-player/mpv
synced 2025-01-13 18:45:25 +00:00
parent
5bce4664be
commit
e163284b68
@ -755,3 +755,7 @@ guarantee a stable interface.
|
||||
you could set per-file options with by setting the property
|
||||
``file-local-options/<option name>``. The player will wait until all
|
||||
hooks are run.
|
||||
|
||||
``on_unload``
|
||||
Run before closing a file, and before actually uninitializing
|
||||
everything. It's not possible to resume playback in this state.
|
||||
|
@ -808,6 +808,14 @@ static int process_open_hooks(struct MPContext *mpctx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void process_unload_hooks(struct MPContext *mpctx)
|
||||
{
|
||||
mp_hook_run(mpctx, NULL, "on_unload");
|
||||
|
||||
while (!mp_hook_test_completion(mpctx, "on_unload"))
|
||||
mp_idle(mpctx);
|
||||
}
|
||||
|
||||
static void print_timeline(struct MPContext *mpctx)
|
||||
{
|
||||
if (mpctx->timeline) {
|
||||
@ -1212,6 +1220,8 @@ terminate_playback:
|
||||
goto goto_reopen_demuxer;
|
||||
}
|
||||
|
||||
process_unload_hooks(mpctx);
|
||||
|
||||
mp_nav_destroy(mpctx);
|
||||
|
||||
if (mpctx->stop_play == KEEP_PLAYING)
|
||||
|
Loading…
Reference in New Issue
Block a user