diff options
author | Carl Hetherington <carl@carlh.net> | 2010-09-14 23:15:43 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-09-14 23:15:43 +0000 |
commit | 90ad837c906cecebb4050de24be75c713a3d4675 (patch) | |
tree | 4f963bf43491a9d8e7f84816701db0a74b74f58a /libs/ardour/ardour/audiosource.h | |
parent | d5c1e67c567244790f708caec706865da1760ae1 (diff) |
Tidy up PeaksReady locking slightly and emit it during done_with_peakfile_writes. Fixes some non-appearing peaks after record.
git-svn-id: svn://localhost/ardour2/branches/3.0@7776 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/audiosource.h')
-rw-r--r-- | libs/ardour/ardour/audiosource.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libs/ardour/ardour/audiosource.h b/libs/ardour/ardour/audiosource.h index 7ea7260688..36c79f6787 100644 --- a/libs/ardour/ardour/audiosource.h +++ b/libs/ardour/ardour/audiosource.h @@ -60,7 +60,7 @@ class AudioSource : virtual public Source, virtual float sample_rate () const = 0; - virtual void mark_streaming_write_completed () {} + virtual void mark_streaming_write_completed (); virtual bool can_truncate_peaks() const { return true; } @@ -111,8 +111,6 @@ class AudioSource : virtual public Source, static bool _build_peakfiles; framecnt_t _length; - bool _peaks_built; - mutable Glib::Mutex _peaks_ready_lock; std::string peakpath; std::string _captured_for; @@ -142,6 +140,15 @@ class AudioSource : virtual public Source, framecnt_t frames_per_peak); private: + bool _peaks_built; + /** This mutex is used to protect both the _peaks_built + * variable and also the emission (and handling) of the + * PeaksReady signal. Holding the lock when emitting + * PeaksReady means that _peaks_built cannot be changed + * during the handling of the signal. + */ + mutable Glib::Mutex _peaks_ready_lock; + PBD::FdFileDescriptor* _peakfile_descriptor; int _peakfile_fd; framecnt_t peak_leftover_cnt; |