X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=aft.c;h=b9db5a819fd13ebf7f780a0afdfe20d63cbc14f5;hp=3666a2eb90de28431dd25b5adbac41503bf80d92;hb=cd38753609763dbc55e72a7df446837792628d6d;hpb=5273ef18fa909e5236fde2e1d320e0e270bc3f22 diff --git a/aft.c b/aft.c index 3666a2eb..b9db5a81 100644 --- a/aft.c +++ b/aft.c @@ -138,8 +138,10 @@ enum afsi_offsets { AFSI_LYRICS_ID_OFFSET = 24, /** Storage position of the .audio_format_id field. */ AFSI_AUDIO_FORMAT_ID_OFFSET = 28, + /** 3 bytes reserved space for future usage. */ + AFSI_AUDIO_FORMAT_UNUSED_OFFSET = 29, /** On-disk storage space needed. */ - AFSI_SIZE = 29 + AFSI_SIZE = 32 }; /** @@ -161,6 +163,7 @@ void save_afsi(struct afs_info *afsi, struct osl_object *obj) write_u32(buf + AFSI_LYRICS_ID_OFFSET, afsi->lyrics_id); write_u8(buf + AFSI_AUDIO_FORMAT_ID_OFFSET, afsi->audio_format_id); + memset(buf + AFSI_AUDIO_FORMAT_UNUSED_OFFSET, 0, 3); } /** @@ -616,6 +619,7 @@ int open_and_update_audio_file(struct osl_row *aft_row, struct audio_file_data * struct osl_object afsi_obj; struct afs_info new_afsi; int ret = get_hash_of_row(aft_row, &aft_hash); + struct afsi_change_event_data aced; if (ret < 0) return ret; @@ -645,13 +649,11 @@ int open_and_update_audio_file(struct osl_row *aft_row, struct audio_file_data * new_afsi.num_played++; new_afsi.last_played = time(NULL); save_afsi(&new_afsi, &afsi_obj); /* in-place update */ - if (afd->current_play_mode == PLAY_MODE_PLAYLIST) - ret = playlist_update_audio_file(aft_row); - else { - struct afsi_change_event_data aced = {.aft_row = aft_row, - .old_afsi = &afd->afsi}; - afs_event(AFSI_CHANGE, NULL, &aced); - } + + aced.aft_row = aft_row; + aced.old_afsi = &afd->afsi; + afs_event(AFSI_CHANGE, NULL, &aced); + return ret; err: free(afd->afhi.chunk_table);