From bc70b7bd0ab54816c226eae6c2570e17f97768f6 Mon Sep 17 00:00:00 2001 From: Michael Hohmuth Date: Wed, 17 Nov 2010 22:42:44 +0100 Subject: [PATCH 1/2] audio_stop_playback: Send a PLAYBACK_EVENT_TRACK_FINISH event to make sure stats are saved (but only if we're not in a track transition -- otherwise the event will have been generated already.) --- apps/playback.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/apps/playback.c b/apps/playback.c index f3c5db3..b18ba14 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -1685,6 +1685,12 @@ static void audio_stop_playback(void) /* Save the current playing spot, or NULL if the playlist has ended */ playlist_update_resume_info(id3); + /* Now it's good time to send track finish events. Do this + only if this hasn't been done already as part of a track + switch. */ + if (id3 == thistrack_id3) + send_event(PLAYBACK_EVENT_TRACK_FINISH, thistrack_id3); + /* TODO: Create auto bookmark too? */ prev_track_elapsed = othertrack_id3->elapsed; -- 1.7.1