From 86094c2c5ae634b9ff02a85e51c33955b31babfa Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 11 Apr 2014 01:23:32 +0200 Subject: client API: include the reason in MPV_EVENT_END_FILE Otherwise, the client API user could not know why playback was stopped. Regarding the fact that 0 is used both for normal EOF and EOF on error: this is because mplayer traditionally did not distinguish these, and in general it's hard to tell the real reason. (There are various weird corner cases which make it hard.) --- player/client.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'player/client.c') diff --git a/player/client.c b/player/client.c index 2347f19fbd..642937421d 100644 --- a/player/client.c +++ b/player/client.c @@ -393,6 +393,9 @@ static void dup_event_data(struct mpv_event *ev) ev->data = msg; break; } + case MPV_EVENT_END_FILE: + ev->data = talloc_memdup(NULL, ev->data, sizeof(mpv_event_end_file)); + break; default: // Doesn't use events with memory allocation. if (ev->data) -- cgit v1.2.3