From: Andre Noll Date: Sun, 20 Aug 2017 13:54:25 +0000 (+0200) Subject: Merge branch 'refs/heads/t/si_update' X-Git-Tag: v0.6.1~18 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=a61e862450dc1e74394bf5bbf7002d9947f98d31;hp=1e188f3ad67851a95a65cfdae976b9e92d244ee9 Merge branch 'refs/heads/t/si_update' A single patch which teaches the afs event handler to trigger a status item update when the image or lyrics table changes. This patch had a bug which was only noticed after the branch had been merged to next. Therefore the series contains a fixup commit. Cooking for almost two months. * refs/heads/t/si_update: server: Avoid NULL pointer dereference in make_status_items(). Update status items on blob events. --- diff --git a/NEWS.md b/NEWS.md index 931ddbb8..d9f092c9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -16,6 +16,9 @@ current master branch removed. It was a no-op since 0.6.0. - The wma decoder has been cleaned up and its bitstream API made more robust. +- The image/lyrics ID status items of the current audio file are now + updated on changes. This affects para_gui, which used to report the + old value until EOF. ------------------------------- 0.6.0 (2017-04-28) "fuzzy flux" diff --git a/aft.c b/aft.c index 7a6d3f22..6c07bcc2 100644 --- a/aft.c +++ b/aft.c @@ -991,6 +991,8 @@ static int make_status_items(void) time_t current_time; int ret; + if (!status_item_ls_data.path) /* no audio file open */ + return 0; ret = lls_parse(ARRAY_SIZE(argv), argv, cmd, &opts.lpr, NULL); assert(ret >= 0); time(¤t_time); @@ -2569,6 +2571,16 @@ static int aft_event_handler(enum afs_events event, struct para_buffer *pb, return ret; make_status_items(); return 1; + } + case BLOB_RENAME: + case BLOB_REMOVE: + case BLOB_ADD: { + /* + * These events are rare. We don't bother to check whether the + * current status items are affected and simply recreate them + * every time. + */ + make_status_items(); } default: return 0; }