notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
spu: sync on xa playback start
[pcsx_rearmed.git]
/
plugins
/
dfsound
/
spu.c
diff --git
a/plugins/dfsound/spu.c
b/plugins/dfsound/spu.c
index
fbd555b
..
3aaf53a
100644
(file)
--- a/
plugins/dfsound/spu.c
+++ b/
plugins/dfsound/spu.c
@@
-1298,20
+1298,26
@@
void CALLBACK SPUupdate(void)
// XA AUDIO
// XA AUDIO
-void CALLBACK SPUplayADPCMchannel(xa_decode_t *xap)
+void CALLBACK SPUplayADPCMchannel(xa_decode_t *xap
, unsigned int cycle, int is_start
)
{
if(!xap) return;
{
if(!xap) return;
- if(!xap->freq) return;
// no xa freq ? bye
+ if(!xap->freq) return; // no xa freq ? bye
- FeedXA(xap); // call main XA feeder
+ if (is_start)
+ do_samples(cycle, 1); // catch up to prevent source underflows later
+
+ FeedXA(xap); // call main XA feeder
}
// CDDA AUDIO
}
// CDDA AUDIO
-int CALLBACK SPUplayCDDAchannel(short *pcm, int nbytes)
+int CALLBACK SPUplayCDDAchannel(short *pcm, int nbytes
, unsigned int cycle, int is_start
)
{
if (!pcm) return -1;
if (nbytes<=0) return -1;
{
if (!pcm) return -1;
if (nbytes<=0) return -1;
+ if (is_start)
+ do_samples(cycle, 1); // catch up to prevent source underflows later
+
return FeedCDDA((unsigned char *)pcm, nbytes);
}
return FeedCDDA((unsigned char *)pcm, nbytes);
}