Skip to content
This repository
Browse code

Merge pull request #3304 from FernetMenta/cuefile

paplayer: fix gapless playback of cue file if added to music db
  • Loading branch information...
commit b632a086cf9d98dc4902130dd3fbb0513e7a5c7b 2 parents 96c6a25 + 0709147
Rainer Hochecker authored September 20, 2013

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. 6  xbmc/cores/paplayer/PAPlayer.cpp
6  xbmc/cores/paplayer/PAPlayer.cpp
@@ -317,7 +317,7 @@ bool PAPlayer::QueueNextFileEx(const CFileItem &file, bool fadeIn/* = true */, b
317 317
 
318 318
   // check if we advance a track of a CUE sheet
319 319
   // if this is the case we don't need to open a new stream
320  
-  if (file.GetPath().Equals(m_FileItem->GetPath()) &&
  320
+  if (file.GetMusicInfoTag()->GetURL().Equals(m_FileItem->GetMusicInfoTag()->GetURL()) &&
321 321
       file.m_lStartOffset &&
322 322
       file.m_lStartOffset == m_FileItem->m_lEndOffset &&
323 323
       m_currentStream && m_currentStream->m_prepareTriggered)
@@ -707,6 +707,7 @@ inline bool PAPlayer::ProcessStream(StreamInfo *si, double &delay, double &buffe
707 707
       si->m_framesSent = (int)(si->m_seekFrame - ((float)si->m_startOffset * (float)si->m_sampleRate) / 1000.0f);
708 708
       si->m_seekFrame  = -1;
709 709
       m_playerGUIData.m_time = time; //update for GUI
  710
+      si->m_seekNextAtFrame = 0;
710 711
     }
711 712
     /* if its FF/RW */
712 713
     else
@@ -720,7 +721,7 @@ inline bool PAPlayer::ProcessStream(StreamInfo *si, double &delay, double &buffe
720 721
     if (time < si->m_startOffset || si->m_framesSent < 0)
721 722
     {
722 723
       time = si->m_startOffset;
723  
-      si->m_framesSent      = (int)(si->m_startOffset * si->m_sampleRate / 1000);
  724
+      si->m_framesSent      = 0;
724 725
       si->m_seekNextAtFrame = 0;
725 726
       ToFFRW(1);
726 727
     }
@@ -756,6 +757,7 @@ inline bool PAPlayer::ProcessStream(StreamInfo *si, double &delay, double &buffe
756 757
       si->m_prepareTriggered = false;
757 758
       si->m_playNextAtFrame = 0;
758 759
       si->m_playNextTriggered = false;
  760
+      si->m_seekNextAtFrame = 0;
759 761
 
760 762
       //update the current stream to start playing the next track at the correct frame.
761 763
       UpdateStreamInfoPlayNextAtFrame(m_currentStream, m_upcomingCrossfadeMS);

0 notes on commit b632a08

Please sign in to comment.
Something went wrong with that request. Please try again.