Skip to content
This repository
Browse code

Merge pull request #2625 from hmis/AirTunes_pts

Fix AirTunes pts accuracy
  • Loading branch information...
commit a894e5e6e8e2e4d3e07750aa68c88264ea8dbe21 2 parents 48b61aa + a4e2d5b
Joakim Plate authored
9  xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxBXA.cpp
@@ -51,6 +51,7 @@ CDVDDemuxBXA::CDVDDemuxBXA() : CDVDDemux()
51 51
 {
52 52
   m_pInput = NULL;
53 53
   m_stream = NULL;
  54
+  m_bytes = 0;
54 55
   memset(&m_header, 0x0, sizeof(Demux_BXA_FmtHeader));
55 56
 }
56 57
 
@@ -101,7 +102,7 @@ void CDVDDemuxBXA::Dispose()
101 102
   m_stream = NULL;
102 103
 
103 104
   m_pInput = NULL;
104  
-  m_pts    = 0;
  105
+  m_bytes = 0;
105 106
 
106 107
   memset(&m_header, 0x0, sizeof(Demux_BXA_FmtHeader));
107 108
 }
@@ -151,9 +152,9 @@ DemuxPacket* CDVDDemuxBXA::Read()
151 152
     int n = (m_header.channels * m_header.bitsPerSample * m_header.sampleRate)>>3;
152 153
     if (n > 0)
153 154
     {
154  
-      m_pts += ((double)pPacket->iSize * DVD_TIME_BASE) / n;
155  
-      pPacket->dts = m_pts;
156  
-      pPacket->pts = m_pts;
  155
+      m_bytes += pPacket->iSize;
  156
+      pPacket->dts = (double)m_bytes * DVD_TIME_BASE / n;
  157
+      pPacket->pts = pPacket->dts;
157 158
     }
158 159
     else
159 160
     {
2  xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxBXA.h
@@ -76,7 +76,7 @@ class CDVDDemuxBXA : public CDVDDemux
76 76
 protected:
77 77
   friend class CDemuxStreamAudioBXA;
78 78
   CDVDInputStream* m_pInput;
79  
-  double m_pts;
  79
+  int64_t m_bytes;
80 80
 
81 81
   CDemuxStreamAudioBXA *m_stream;
82 82
 

0 notes on commit a894e5e

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