From a25823bbc28bfb93f1330d7421bd2589c01386c1 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 18 Jun 2018 22:33:48 +0800 Subject: Precise playback (no more slowdown). Also the visualization should now sync better. --- core/qmpmidiread.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/qmpmidiread.cpp') diff --git a/core/qmpmidiread.cpp b/core/qmpmidiread.cpp index e7d92d3..d5f20ff 100644 --- a/core/qmpmidiread.cpp +++ b/core/qmpmidiread.cpp @@ -100,7 +100,8 @@ int CSMFReader::eventReader()//returns 0 if End of Track encountered break; case 0x59://Key signature assert(len==2); - p1=(str[0]&0xffu)<<8u|(str[1]&0xffu); + if(len>=2) + p1=(str[0]&0xffu)<<8u|(str[1]&0xffu);else p1=0; curTrack->appendEvent(SEvent(curid,curt,type,metatype,p1)); break; case 0x01:case 0x02:case 0x03: -- cgit v1.2.3