From 3cde02fe2292bbc6e213b6a619c2bafa21412276 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 28 Oct 2014 15:44:25 +0100 Subject: client API: add an enum for mpv_event_end_file.reason Using magic integer values was an attempt to keep the API less verbose. But it was probably not a good idea. Reason 1 (restart) is not made explicit, because it is not used anymore starting with the previous commit. For ABI compatibility, the value is left as a hole in the enum. --- player/loadfile.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'player/loadfile.c') diff --git a/player/loadfile.c b/player/loadfile.c index 68d8f78da1..58b9cf9f68 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1184,12 +1184,11 @@ terminate_playback: mp_notify(mpctx, MPV_EVENT_TRACKS_CHANGED, NULL); struct mpv_event_end_file end_event = {0}; switch (mpctx->stop_play) { - case AT_END_OF_FILE: end_event.reason = 0; break; + case AT_END_OF_FILE: end_event.reason = MPV_END_FILE_REASON_EOF; break; case PT_NEXT_ENTRY: case PT_CURRENT_ENTRY: - case PT_STOP: end_event.reason = 2; break; - case PT_QUIT: end_event.reason = 3; break; - default: end_event.reason = -1; break; + case PT_STOP: end_event.reason = MPV_END_FILE_REASON_STOP; break; + case PT_QUIT: end_event.reason = MPV_END_FILE_REASON_QUIT; break; }; mp_notify(mpctx, MPV_EVENT_END_FILE, &end_event); -- cgit v1.2.3