lua: add playback-start event

This commit is contained in:
wm4 2014-01-20 19:30:52 +01:00
parent 0f5e22079a
commit 119efdc197
3 changed files with 4 additions and 0 deletions

View File

@ -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: ;

View File

@ -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,
};

View File

@ -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)