aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin van Beurden <chadoe@xbmc.org>2012-07-08 15:46:04 +0200
committerMartin van Beurden <chadoe@xbmc.org>2012-07-08 16:06:38 +0200
commit5fe725d196a87807e399a4788c91426f8fc87709 (patch)
treec5465d4dd35e399a26fd750bf726861c53fb4c1f
parentfa3caa24cbeddbd37d265861992f4e56b2ec6816 (diff)
restored: paplayer short crossfade on trackskip if crossfade is enabled functionality.
-rw-r--r--xbmc/cores/paplayer/PAPlayer.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/xbmc/cores/paplayer/PAPlayer.cpp b/xbmc/cores/paplayer/PAPlayer.cpp
index 81203fddb9..c49863b111 100644
--- a/xbmc/cores/paplayer/PAPlayer.cpp
+++ b/xbmc/cores/paplayer/PAPlayer.cpp
@@ -37,6 +37,7 @@
#define TIME_TO_CACHE_NEXT_FILE 5000 /* 5 seconds before end of song, start caching the next song */
#define FAST_XFADE_TIME 80 /* 80 milliseconds */
+#define MAX_SKIP_XFADE_TIME 2000 /* max 2 seconds crossfade on track skip */
// PAP: Psycho-acoustic Audio Player
// Supporting all open audio codec standards.
@@ -233,6 +234,19 @@ bool PAPlayer::OpenFile(const CFileItem& file, const CPlayerOptions &options)
if (!QueueNextFileEx(file, false))
return false;
+ CSharedLock lock(m_streamsLock);
+ if (m_streams.size() == 2)
+ {
+ //do a short crossfade on trackskip, set to max 2 seconds for these prev/next transitions
+ m_upcomingCrossfadeMS = std::min(m_defaultCrossfadeMS, (unsigned int)MAX_SKIP_XFADE_TIME);
+
+ //start transition to next track
+ StreamInfo* si = m_streams.front();
+ si->m_playNextAtFrame = si->m_framesSent; //start next track at current frame
+ si->m_prepareTriggered = true; //next track is ready to go
+ }
+ lock.Leave();
+
if (!IsRunning())
Create();