forked from bartvdbraak/blender
Fix T40280: sequencer sound strips with an end at a negative time kept playing
The bug was caused by using negative numbers as the end for playing forever (or until the end of the sound is reached) in the library. This was used with speaker objects which have an end of FLT_MAX now instead and the negative number interpretation was removed. I hope this doesn't break anything else.
This commit is contained in:
parent
3bba558944
commit
38fcc3e14b
@ -70,7 +70,7 @@ void AUD_SequencerHandle::update(float position, float frame, float fps)
|
|||||||
if(m_handle.get())
|
if(m_handle.get())
|
||||||
{
|
{
|
||||||
AUD_MutexLock lock(*m_entry);
|
AUD_MutexLock lock(*m_entry);
|
||||||
if(position >= m_entry->m_end && m_entry->m_end >= 0)
|
if(position >= m_entry->m_end)
|
||||||
m_handle->pause();
|
m_handle->pause();
|
||||||
else if(position >= m_entry->m_begin)
|
else if(position >= m_entry->m_begin)
|
||||||
m_handle->resume();
|
m_handle->resume();
|
||||||
@ -143,7 +143,7 @@ void AUD_SequencerHandle::seek(float position)
|
|||||||
if(m_handle.get())
|
if(m_handle.get())
|
||||||
{
|
{
|
||||||
AUD_MutexLock lock(*m_entry);
|
AUD_MutexLock lock(*m_entry);
|
||||||
if(position >= m_entry->m_end && m_entry->m_end >= 0)
|
if(position >= m_entry->m_end)
|
||||||
{
|
{
|
||||||
m_handle->pause();
|
m_handle->pause();
|
||||||
return;
|
return;
|
||||||
|
@ -727,7 +727,7 @@ void sound_update_scene(Main *bmain, struct Scene *scene)
|
|||||||
|
|
||||||
if (AUD_removeSet(scene->speaker_handles, strip->speaker_handle)) {
|
if (AUD_removeSet(scene->speaker_handles, strip->speaker_handle)) {
|
||||||
if (speaker->sound) {
|
if (speaker->sound) {
|
||||||
AUD_moveSequence(strip->speaker_handle, (double)strip->start / FPS, -1, 0);
|
AUD_moveSequence(strip->speaker_handle, (double)strip->start / FPS, FLT_MAX, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
AUD_removeSequence(scene->sound_scene, strip->speaker_handle);
|
AUD_removeSequence(scene->sound_scene, strip->speaker_handle);
|
||||||
@ -738,7 +738,7 @@ void sound_update_scene(Main *bmain, struct Scene *scene)
|
|||||||
if (speaker->sound) {
|
if (speaker->sound) {
|
||||||
strip->speaker_handle = AUD_addSequence(scene->sound_scene,
|
strip->speaker_handle = AUD_addSequence(scene->sound_scene,
|
||||||
speaker->sound->playback_handle,
|
speaker->sound->playback_handle,
|
||||||
(double)strip->start / FPS, -1, 0);
|
(double)strip->start / FPS, FLT_MAX, 0);
|
||||||
AUD_setRelativeSequence(strip->speaker_handle, 0);
|
AUD_setRelativeSequence(strip->speaker_handle, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user