aboutsummaryrefslogtreecommitdiff
path: root/core/qmpmidiread.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2018-06-18 22:33:48 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2018-06-18 22:33:48 +0800
commita25823bbc28bfb93f1330d7421bd2589c01386c1 (patch)
treeaa5ceffaff372b1f18d51bd5ab702ae977f2293c /core/qmpmidiread.cpp
parent9e228490ffc7deb2969fa5e2b5fd81d763986eed (diff)
downloadQMidiPlayer-a25823bbc28bfb93f1330d7421bd2589c01386c1.tar.xz
Precise playback (no more slowdown).
Also the visualization should now sync better.
Diffstat (limited to 'core/qmpmidiread.cpp')
-rw-r--r--core/qmpmidiread.cpp3
1 files changed, 2 insertions, 1 deletions
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: