From 34db35c36d8bb32b2c41640432474f52889cce08 Mon Sep 17 00:00:00 2001
From: xent <alexdmitv@gmail.com>
Date: Wed, 5 Aug 2015 23:37:57 +0200
Subject: [PATCH] playlist/embcue: fix last track

---
 NEWS                                               | 2 ++
 src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 98f1ccd6c..acff1a48f 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,8 @@ ver 0.20 (not yet released)
   - ffmpeg: support ReplayGain and MixRamp
   - ffmpeg: support stream tags
   - mpcdec: read the bit rate
+* playlist
+  - embcue: fix last track
 * output
   - jack: reduce CPU usage
   - pulse: set channel map to WAVE-EX
diff --git a/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx b/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx
index 29b15b1de..e12dc2df0 100644
--- a/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx
+++ b/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx
@@ -128,8 +128,10 @@ DetachedSong *
 EmbeddedCuePlaylist::NextSong()
 {
 	DetachedSong *song = parser->Get();
-	if (song != nullptr)
+	if (song != nullptr) {
+		song->SetURI(filename);
 		return song;
+	}
 
 	while (*next != 0) {
 		const char *line = next;