From c30fa77db9a1a4f75dc5814cb9f4ecbd32aa110a Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 2 Nov 2007 00:49:03 +0100 Subject: [PATCH] Fix duplicate afs event add. This bug hits if a request to update an existing audio file is made. The old code caused an AFHI_CHANGE event and then did "goto out;" which raises nother event (AUDIO_FILE_ADD). Fix it by moving the event-raising code some lines up. --- aft.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aft.c b/aft.c index fae883b4..02953b5c 100644 --- a/aft.c +++ b/aft.c @@ -1609,6 +1609,7 @@ static int com_add_callback(const struct osl_object *query, objs[AFTCOL_AFSI].size = AFSI_SIZE; save_afsi(&default_afsi, &objs[AFTCOL_AFSI]); ret = osl_add_and_get_row(audio_file_table, objs, &aft_row); + afs_event(AUDIO_FILE_ADD, &msg, aft_row); out: if (ret < 0) para_printf(&msg, "%s\n", PARA_STRERROR(-ret)); @@ -1616,7 +1617,6 @@ out: return 0; result->data = msg.buf; result->size = msg.size; - afs_event(AUDIO_FILE_ADD, &msg, aft_row); return 1; } -- 2.39.5