]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - aft.c
Merge branch 'refs/heads/t/immediate-si-update'
[paraslash.git] / aft.c
diff --git a/aft.c b/aft.c
index fb0d4fd252b6091c2c7a3ae280d2746cc3519a36..acf751566c61d82e23cc34565c1189f2db147917 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -669,16 +669,13 @@ err:
 int load_afd(int shmid, struct audio_file_data *afd)
 {
        void *shm_afd;
-       char *buf;
        int ret;
 
        ret = shm_attach(shmid, ATTACH_RO, &shm_afd);
        if (ret < 0)
                return ret;
        *afd = *(struct audio_file_data *)shm_afd;
-       buf = shm_afd;
-       buf += sizeof(*afd);
-       load_chunk_table(&afd->afhi, buf);
+       load_chunk_table(&afd->afhi, shm_afd + sizeof(*afd));
        shm_detach(shm_afd);
        return 1;
 }
@@ -1121,13 +1118,13 @@ again:
                return ret;
        ret = mmap_full_file(d->path, O_RDONLY, &map.data, &map.size, &afd->fd);
        if (ret < 0)
-               goto err;
+               goto out;
        hash_function(map.data, map.size, file_hash);
        ret = hash_compare(file_hash, d->hash);
        para_munmap(map.data, map.size);
        if (ret) {
                ret = -E_HASH_MISMATCH;
-               goto err;
+               goto out;
        }
        new_afsi = d->afsi;
        new_afsi.num_played++;
@@ -1144,7 +1141,7 @@ again:
         */
        afs_event(AFSI_CHANGE, NULL, &aced);
        ret = save_afd(afd);
-err:
+out:
        free(afd->afhi.chunk_table);
        osl_close_disk_object(&chunk_table_obj);
        if (ret < 0) {
@@ -2103,7 +2100,10 @@ static void com_touch_callback(int fd, const struct osl_object *query)
        struct touch_action_data tad = {.cto = query->data,
                .pb = {
                        .max_size = shm_get_shmmax(),
-                       .private_data = &fd,
+                       .private_data = &(struct afs_max_size_handler_data) {
+                               .fd = fd,
+                               .band = SBD_OUTPUT
+                       },
                        .max_size_handler = afs_max_size_handler
                }
        };
@@ -2244,7 +2244,10 @@ static void com_rm_callback(int fd, const struct osl_object *query)
        struct com_rm_action_data crd = {.flags = *(uint32_t *)query->data,
                .pb = {
                        .max_size = shm_get_shmmax(),
-                       .private_data = &fd,
+                       .private_data = &(struct afs_max_size_handler_data) {
+                               .fd = fd,
+                               .band = SBD_OUTPUT
+                       },
                        .max_size_handler = afs_max_size_handler
                }
        };
@@ -2386,7 +2389,10 @@ static void com_cpsi_callback(int fd, const struct osl_object *query)
                .flags = *(unsigned *)query->data,
                .pb = {
                        .max_size = shm_get_shmmax(),
-                       .private_data = &fd,
+                       .private_data = &(struct afs_max_size_handler_data) {
+                               .fd = fd,
+                               .band = SBD_OUTPUT
+                       },
                        .max_size_handler = afs_max_size_handler
                }
        };