From: Andre Noll Date: Sun, 26 Apr 2015 12:11:56 +0000 (+0200) Subject: Merge branch 'refs/heads/t/immediate-si-update' X-Git-Tag: v0.5.5~40 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=1a8e3628040a94a8c06027335962a6cb2f827a63 Merge branch 'refs/heads/t/immediate-si-update' Cooking in next for four weeks. * aft: Store resolved paths when adding files. * aft: Update mtime and file size on afhi changes. * aft: Update status items on afs events. * aft.c: Pass struct ls_data pointer to make_status_items(). * afs: Simplify open_next_audio_file(). Conflicts: aft.c --- 1a8e3628040a94a8c06027335962a6cb2f827a63 diff --cc NEWS index c0ba3b28,b29d4b82..22e16ebe --- a/NEWS +++ b/NEWS @@@ -7,10 -7,8 +7,12 @@@ current master branch "magnetic momentu - On Linux systems, local sockets are now created in the abstract name space by default. This allows to get rid of the socket specials in /var/paraslash. + - New autoconf macros to avoid duplication in configure.ac. - ++ - Status items (as shown by para_gui) are updated correctly ++ when the meta information of the current audio changes. Download: ./releases/paraslash-git.tar.bz2 (tarball) ++ ------------------------------------------ 0.5.4 (2015-01-23) "exponential alignment" ------------------------------------------ diff --cc aft.c index 826fc28b,fb0d4fd2..acf75156 --- a/aft.c +++ b/aft.c @@@ -1120,35 -1119,40 +1116,40 @@@ again AFTCOL_CHUNKS, &chunk_table_obj)); if (ret < 0) return ret; - ret = mmap_full_file(path, O_RDONLY, &map.data, &map.size, &afd->fd); + 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, aft_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 = old_afsi; + new_afsi = d->afsi; new_afsi.num_played++; new_afsi.last_played = time(NULL); save_afsi(&new_afsi, &afsi_obj); /* in-place update */ - afd->audio_format_id = old_afsi.audio_format_id; + afd->audio_format_id = d->afsi.audio_format_id; load_chunk_table(&afd->afhi, chunk_table_obj.data); - ret = make_status_items(afd, &old_afsi, path, score, file_hash); - if (ret < 0) - goto out; - aced.aft_row = aft_row; - aced.old_afsi = &old_afsi; + aced.aft_row = current_aft_row; + aced.old_afsi = &d->afsi; + /* + * No need to update the status items as the AFSI_CHANGE event will + * recreate them. + */ 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) - PARA_ERROR_LOG("%s: %s\n", path, para_strerror(-ret)); + if (ret < 0) { + PARA_ERROR_LOG("%s: %s\n", d->path, para_strerror(-ret)); + ret = score_delete(current_aft_row); + if (ret >= 0) + goto again; + } return ret; }