Bugfix for gif player WRT inactive segment and bugfix in copy FX
- if a segment is destroyed or turned inactive, disable the gif player: only one gif player instance can run at a time, if a inactive or destroyed segment uses it, the effect is broken for other segments. - copy FX ironically copied the source segment on each call, should use reference not a copy!
This commit is contained in:
@@ -16,6 +16,10 @@
|
||||
bool canUseSerial(void); // WLEDMM implemented in wled_serial.cpp
|
||||
void strip_wait_until_idle(String whoCalledMe); // WLEDMM implemented in FX_fcn.cpp
|
||||
bool strip_uses_global_leds(void) __attribute__((pure)); // WLEDMM implemented in FX_fcn.cpp
|
||||
#ifdef WLED_ENABLE_GIF
|
||||
struct Segment; // forward declaration
|
||||
void endImagePlayback(Segment *seg); // implemented in image_loader.cpp
|
||||
#endif
|
||||
|
||||
#define FASTLED_INTERNAL //remove annoying pragma messages
|
||||
#define USE_GET_MILLISECOND_TIMER
|
||||
@@ -585,6 +589,9 @@ typedef struct Segment {
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
strip_wait_until_idle("~Segment()");
|
||||
#endif
|
||||
#ifdef WLED_ENABLE_GIF
|
||||
endImagePlayback(this);
|
||||
#endif
|
||||
|
||||
if ((Segment::_globalLeds == nullptr) && !strip_uses_global_leds() && (ledsrgb != nullptr)) {free(ledsrgb); ledsrgb = nullptr;} // WLEDMM we need "!strip_uses_global_leds()" to avoid crashes (#104)
|
||||
if (name) { delete[] name; name = nullptr; }
|
||||
|
||||
@@ -542,6 +542,9 @@ void Segment::setUp(uint16_t i1, uint16_t i2, uint8_t grp, uint8_t spc, uint16_t
|
||||
|
||||
if (stop>start) markForBlank(); //turn old segment range off // WLEDMM stop > start // toDo: check if this can be skipped when boundsUnchanged
|
||||
if (i2 <= i1) { //disable segment
|
||||
#ifdef WLED_ENABLE_GIF
|
||||
endImagePlayback(this);
|
||||
#endif
|
||||
stop = 0;
|
||||
markForReset();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user