diff data/fileio/CodedAudioFileReader.h @ 543:7a66b94ef1c0

* Thread safety (fixing a crash)
author Chris Cannam
date Wed, 04 Feb 2009 10:53:38 +0000
parents b92513201610
children 65d955c4d671
line wrap: on
line diff
--- a/data/fileio/CodedAudioFileReader.h	Tue Feb 03 11:12:19 2009 +0000
+++ b/data/fileio/CodedAudioFileReader.h	Wed Feb 04 10:53:38 2009 +0000
@@ -20,6 +20,7 @@
 
 #include <sndfile.h>
 #include <QMutex>
+#include <QReadWriteLock>
 
 class WavFileReader;
 class Serialiser;
@@ -65,6 +66,7 @@
     QMutex m_cacheMutex;
     CacheMode m_cacheMode;
     SampleBlock m_data;
+    mutable QReadWriteLock m_dataLock;
     bool m_initialised;
     Serialiser *m_serialiser;
     size_t m_fileRate;