]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 'refs/heads/t/si_update'
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 20 Aug 2017 13:54:25 +0000 (15:54 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 20 Aug 2017 13:55:47 +0000 (15:55 +0200)
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.

NEWS.md
aft.c

diff --git a/NEWS.md b/NEWS.md
index 931ddbb8844290638884627be0fdeffb7031c216..d9f092c93003d764f85723369d53ee717b6594e9 100644 (file)
--- 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 7a6d3f22e2361c42b5faca9d2ba240688215faec..6c07bcc2a13deb72985f7b87fb98c689c1c38a96 100644 (file)
--- 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(&current_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;
        }