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.
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));
return 0;
result->data = msg.buf;
result->size = msg.size;
- afs_event(AUDIO_FILE_ADD, &msg, aft_row);
return 1;
}