From c30bf22d8d31336696430406b0483bfc9821c8bb Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 28 Feb 2014 01:31:38 +0100 Subject: client API: rename MPV_EVENT_PLAYBACK_START, add MPV_EVENT_SEEK Rename MPV_EVENT_PLAYBACK_START to MPV_EVENT_FILE_LOADED. Add MPV_EVENT_SEEK and MPV_EVENT_PLAYBACK_RESTART. --- player/client.c | 4 +++- player/loadfile.c | 2 +- player/playloop.c | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'player') diff --git a/player/client.c b/player/client.c index c1e665a9fb..824389335d 100644 --- a/player/client.c +++ b/player/client.c @@ -997,7 +997,7 @@ static const char *event_table[] = { [MPV_EVENT_COMMAND_REPLY] = "command-reply", [MPV_EVENT_START_FILE] = "start-file", [MPV_EVENT_END_FILE] = "end-file", - [MPV_EVENT_PLAYBACK_START] = "playback-start", + [MPV_EVENT_FILE_LOADED] = "file-loaded", [MPV_EVENT_TRACKS_CHANGED] = "tracks-changed", [MPV_EVENT_TRACK_SWITCHED] = "track-switched", [MPV_EVENT_IDLE] = "idle", @@ -1009,6 +1009,8 @@ static const char *event_table[] = { [MPV_EVENT_VIDEO_RECONFIG] = "video-reconfig", [MPV_EVENT_AUDIO_RECONFIG] = "audio-reconfig", [MPV_EVENT_METADATA_UPDATE] = "metadata-update", + [MPV_EVENT_SEEK] = "seek", + [MPV_EVENT_PLAYBACK_RESTART] = "playback-restart", }; const char *mpv_event_name(mpv_event_id event) diff --git a/player/loadfile.c b/player/loadfile.c index 90b2484ccf..28c4c4f146 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1341,7 +1341,7 @@ goto_reopen_demuxer: ; if (mpctx->opts->pause) pause_player(mpctx, PAUSE_BY_COMMAND); - mp_notify(mpctx, MPV_EVENT_PLAYBACK_START, NULL); + mp_notify(mpctx, MPV_EVENT_FILE_LOADED, NULL); playback_start = mp_time_sec(); mpctx->error_playing = false; diff --git a/player/playloop.c b/player/playloop.c index d1d15ca192..0989b5116c 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -208,6 +208,8 @@ static void seek_reset(struct MPContext *mpctx, bool reset_ao) #if HAVE_ENCODING encode_lavc_discontinuity(mpctx->encode_lavc_ctx); #endif + + mp_notify(mpctx, MPV_EVENT_SEEK, NULL); } // return -1 if seek failed (non-seekable stream?), 0 otherwise @@ -1167,6 +1169,7 @@ void run_playloop(struct MPContext *mpctx) if (mpctx->d_audio) fill_audio_out_buffers(mpctx, endpts); mpctx->restart_playback = false; + mp_notify(mpctx, MPV_EVENT_PLAYBACK_RESTART, NULL); } mpctx->time_frame = 0; get_relative_time(mpctx); @@ -1207,6 +1210,8 @@ void run_playloop(struct MPContext *mpctx) mpctx->opts->playback_speed * buffered_audio); } mpctx->playback_pts = a_pos; + if (was_restart) + mp_notify(mpctx, MPV_EVENT_PLAYBACK_RESTART, NULL); } update_subtitles(mpctx); -- cgit v1.2.3