diff options
author | wm4 <wm4@nowhere> | 2014-01-20 19:30:52 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-01-20 19:31:23 +0100 |
commit | 119efdc19704cc94d4d71fa947fdf7844018abfe (patch) | |
tree | 09a9ffc8c9baf25d60a69f0bf464092bc618a223 /player | |
parent | 0f5e22079a81094e232f30a14800dea6d7561b12 (diff) | |
download | mpv-119efdc19704cc94d4d71fa947fdf7844018abfe.tar.bz2 mpv-119efdc19704cc94d4d71fa947fdf7844018abfe.tar.xz |
lua: add playback-start event
Diffstat (limited to 'player')
-rw-r--r-- | player/command.c | 1 | ||||
-rw-r--r-- | player/command.h | 1 | ||||
-rw-r--r-- | player/loadfile.c | 2 |
3 files changed, 4 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c index 681c48c9ab..fe0c059771 100644 --- a/player/command.c +++ b/player/command.c @@ -3223,6 +3223,7 @@ void mp_flush_events(struct MPContext *mpctx) switch (event) { case MP_EVENT_TICK: name = "tick"; break; case MP_EVENT_TRACKS_CHANGED: name = "track-layout"; break; + case MP_EVENT_PLAYBACK_START: name = "playback-start"; break; case MP_EVENT_START_FILE: name = "start"; break; case MP_EVENT_END_FILE: name = "end"; break; default: ; diff --git a/player/command.h b/player/command.h index 56eb30f859..a676709851 100644 --- a/player/command.h +++ b/player/command.h @@ -40,6 +40,7 @@ enum mp_event { MP_EVENT_PROPERTY, // char*, property that is changed MP_EVENT_TRACKS_CHANGED, MP_EVENT_START_FILE, + MP_EVENT_PLAYBACK_START, MP_EVENT_END_FILE, }; diff --git a/player/loadfile.c b/player/loadfile.c index b81da983f8..d673a176c2 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1332,6 +1332,8 @@ goto_reopen_demuxer: ; if (mpctx->opts->pause) pause_player(mpctx); + mp_notify(mpctx, MP_EVENT_PLAYBACK_START, NULL); + playback_start = mp_time_sec(); mpctx->error_playing = false; while (!mpctx->stop_play) |