diff options
author | wm4 <wm4@nowhere> | 2014-04-27 22:28:07 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-27 22:28:07 +0200 |
commit | e8a996cedef347f9a4cee1172db39e7f0eea821f (patch) | |
tree | 6e764a5fe26b62e2af6ce6fc62a39d828ec9f713 /player/playloop.c | |
parent | b20416abe3f7e15d27a9828c12171e65f6e62d9c (diff) | |
download | mpv-e8a996cedef347f9a4cee1172db39e7f0eea821f.tar.bz2 mpv-e8a996cedef347f9a4cee1172db39e7f0eea821f.tar.xz |
client API: add chapter change event
Also works for mpv_observe_property() on the "chapter" property.
Diffstat (limited to 'player/playloop.c')
-rw-r--r-- | player/playloop.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/player/playloop.c b/player/playloop.c index d182d090c4..a1cdb0028d 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -845,6 +845,15 @@ static void handle_keep_open(struct MPContext *mpctx) } } +static void handle_chapter_change(struct MPContext *mpctx) +{ + int chapter = get_current_chapter(mpctx); + if (chapter != mpctx->last_chapter) { + mpctx->last_chapter = chapter; + mp_notify(mpctx, MPV_EVENT_CHAPTER_CHANGE, NULL); + } +} + // Execute a forceful refresh of the VO window, if it hasn't had a valid frame // for a while. The problem is that a VO with no valid frame (vo->hasframe==0) // doesn't redraw video and doesn't OSD interaction. So screw it, hard. @@ -1295,6 +1304,8 @@ void run_playloop(struct MPContext *mpctx) handle_keep_open(mpctx); + handle_chapter_change(mpctx); + handle_force_window(mpctx, false); execute_queued_seek(mpctx); |