]> git.alsa-project.org Git - alsa-lib.git/commitdiff
ucm: add another sequence 'msleep'
authorLu Guanqun <guanqun.lu@intel.com>
Mon, 22 Aug 2011 05:35:32 +0000 (13:35 +0800)
committerTakashi Iwai <tiwai@suse.de>
Mon, 22 Aug 2011 10:42:09 +0000 (12:42 +0200)
Thus, we have two sleep statements:
    msleep <milliseconds>
    usleep <microseconds>

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/ucm/parser.c
src/ucm/ucm_local.h

index 23b67bccc06ce7e5147500fb8a08591d83efba1c..b93d8325a99d54a445d49f4fe6e6f29dd0b2a716 100644 (file)
@@ -316,6 +316,17 @@ static int parse_sequence(snd_use_case_mgr_t *uc_mgr ATTRIBUTE_UNUSED,
                        continue;
                }
 
+               if (strcmp(cmd, "msleep") == 0) {
+                       curr->type = SEQUENCE_ELEMENT_TYPE_SLEEP;
+                       err = snd_config_get_integer(n, &curr->data.sleep);
+                       if (err < 0) {
+                               uc_error("error: msleep requires integer!");
+                               return err;
+                       }
+                       curr->data.sleep *= 1000L;
+                       continue;
+               }
+
                if (strcmp(cmd, "exec") == 0) {
                        curr->type = SEQUENCE_ELEMENT_TYPE_EXEC;
                        err = parse_string(n, &curr->data.exec);
index 0522bf55278582c948626b9d64b4964b8c3a6f9f..03d3ace1b309165a88ab4c4c246d3a64845abe0f 100644 (file)
@@ -57,7 +57,7 @@ struct sequence_element {
        struct list_head list;
        unsigned int type;
        union {
-               long sleep; /* Sleep time in msecs if sleep element, else 0 */
+               long sleep; /* Sleep time in microseconds if sleep element, else 0 */
                char *cdev;
                char *cset;
                char *exec;