]> Devoid-pointer.net GitWeb - KLGD_FF_plugin.git/commitdiff
Handle transition from STARTED to STOPPED correctly for combinable
authorMichal Malý <madcatxster@devoid-pointer.net>
Wed, 8 Jul 2015 22:52:38 +0000 (00:52 +0200)
committerMichal Malý <madcatxster@devoid-pointer.net>
Wed, 8 Jul 2015 22:52:38 +0000 (00:52 +0200)
effects.

klgd_ff_plugin.c

index c42183ea9fc9fd680d05a4818aebf85e1d0e11ac..a6a3dde899885bd855f5eac8716ca41bb6a699fa 100644 (file)
@@ -163,11 +163,16 @@ static int ffpl_handle_combinable_effects(struct klgd_plugin_private *priv, stru
                        needs_update = true;
                        printk(KERN_NOTICE "KLGDFF: Altered combinable effect, total active effects %lu\n", active_effects);
                        break;
+               case FFPL_TO_STOP:
+                       if (eff->state == FFPL_STARTED)
+                               needs_update = true;
                case FFPL_TO_UPLOAD:
                        eff->state = FFPL_UPLOADED;
-                       printk(KERN_NOTICE "KLGDFF: Combinable effect to upload, marking as uploaded\n");
+                       printk(KERN_NOTICE "KLGDFF: Combinable effect to upload/stop, marking as uploaded\n");
                        break;
                default:
+                       if (eff->state != FFPL_STARTED)
+                               break;
                        needs_update = true;
                        eff->state = FFPL_EMPTY;
                        printk(KERN_NOTICE "KLGDFF: Stopped combinable effect, total active effects %lu\n", active_effects);