From 39ab426f05826a924cc89b362c60c4b7172cf922 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 15 Feb 2016 16:19:19 +0100 Subject: player: add on_preloaded hook (Limited usefulness.) --- player/loadfile.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'player/loadfile.c') diff --git a/player/loadfile.c b/player/loadfile.c index bd48bb4b0e..7a0afe4c52 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -871,6 +871,19 @@ static int process_open_hooks(struct MPContext *mpctx) return 0; } +static int process_preloaded_hooks(struct MPContext *mpctx) +{ + mp_hook_run(mpctx, NULL, "on_preloaded"); + + while (!mp_hook_test_completion(mpctx, "on_preloaded")) { + mp_idle(mpctx); + if (mpctx->stop_play) + return -1; + } + + return 0; +} + static void process_unload_hooks(struct MPContext *mpctx) { mp_hook_run(mpctx, NULL, "on_unload"); @@ -1256,6 +1269,9 @@ reopen_file: check_previous_track_selection(mpctx); + if (process_preloaded_hooks(mpctx)) + goto terminate_playback; + if (!init_complex_filters(mpctx)) goto terminate_playback; -- cgit v1.2.3