[Bf-blender-cvs] [9676642] gooseberry: Super hacky hack (not for master for sure) to stop blender for crashing with scene audio recursion in mattieu's gooseberry edit in sequencer.

Antony Riakiotakis noreply at git.blender.org
Wed Jun 10 18:20:30 CEST 2015


Commit: 9676642cc94599b3419c9aaa5cf1aae2fbbd235f
Author: Antony Riakiotakis
Date:   Wed Jun 10 18:20:15 2015 +0200
Branches: gooseberry
https://developer.blender.org/rB9676642cc94599b3419c9aaa5cf1aae2fbbd235f

Super hacky hack (not for master for sure) to stop blender for crashing
with scene audio recursion in mattieu's gooseberry edit in sequencer.

Will probably cause something else to explode but let's just guard
against this in the audio lib for now.

===================================================================

M	intern/audaspace/intern/AUD_Sequencer.cpp
M	intern/audaspace/intern/AUD_Sequencer.h
M	intern/audaspace/intern/AUD_SequencerReader.cpp

===================================================================

diff --git a/intern/audaspace/intern/AUD_Sequencer.cpp b/intern/audaspace/intern/AUD_Sequencer.cpp
index ddcf97e..a5b7023 100644
--- a/intern/audaspace/intern/AUD_Sequencer.cpp
+++ b/intern/audaspace/intern/AUD_Sequencer.cpp
@@ -44,7 +44,8 @@ AUD_Sequencer::AUD_Sequencer(AUD_Specs specs, float fps, bool muted) :
 	m_distance_model(AUD_DISTANCE_MODEL_INVERSE_CLAMPED),
 	m_volume(1, 1.0f),
 	m_location(3),
-	m_orientation(4)
+	m_orientation(4),
+	m_recursive(false)
 {
 	AUD_Quaternion q;
 	m_orientation.write(q.get());
diff --git a/intern/audaspace/intern/AUD_Sequencer.h b/intern/audaspace/intern/AUD_Sequencer.h
index 1066eea..ef68efb 100644
--- a/intern/audaspace/intern/AUD_Sequencer.h
+++ b/intern/audaspace/intern/AUD_Sequencer.h
@@ -201,6 +201,8 @@ public:
 	 * \param entry The entry to remove.
 	 */
 	void remove(boost::shared_ptr<AUD_SequencerEntry> entry);
+
+	bool m_recursive;
 };
 
 #endif //__AUD_SEQUENCER_H__
diff --git a/intern/audaspace/intern/AUD_SequencerReader.cpp b/intern/audaspace/intern/AUD_SequencerReader.cpp
index aef93cd..b893b13 100644
--- a/intern/audaspace/intern/AUD_SequencerReader.cpp
+++ b/intern/audaspace/intern/AUD_SequencerReader.cpp
@@ -78,6 +78,9 @@ AUD_Specs AUD_SequencerReader::getSpecs() const
 
 void AUD_SequencerReader::read(int& length, bool& eos, sample_t* buffer)
 {
+	if (m_sequence->m_recursive)
+		return;
+
 	AUD_MutexLock lock(*m_sequence);
 
 	if(m_sequence->m_status != m_status)
@@ -192,7 +195,9 @@ void AUD_SequencerReader::read(int& length, bool& eos, sample_t* buffer)
 		v2 -= v;
 		m_device.setListenerVelocity(v2 * m_sequence->m_fps);
 
+		m_sequence->m_recursive = true;
 		m_device.read(reinterpret_cast<data_t*>(buffer + specs.channels * pos), len);
+		m_sequence->m_recursive = false;
 
 		pos += len;
 		time += float(len) / float(specs.rate);




More information about the Bf-blender-cvs mailing list