decoder_api: added function decoder_replay_gain()

This function replaces the replay_gain_info parameter for
decoder_data().  This allows the decoder to announce replay gain
changes, instead of having to pass the same object over and over.
This commit is contained in:
Max Kellermann
2010-01-03 22:44:23 +01:00
parent e58b4f773f
commit cd8f92c928
23 changed files with 113 additions and 96 deletions

View File

@@ -31,6 +31,7 @@
#include "mapper.h"
#include "path.h"
#include "uri.h"
#include "replay_gain.h"
#include <glib.h>
@@ -302,6 +303,7 @@ decoder_run_song(struct decoder_control *dc,
{
struct decoder decoder = {
.dc = dc,
.replay_gain = NULL,
};
int ret;
@@ -329,6 +331,9 @@ decoder_run_song(struct decoder_control *dc,
pcm_convert_deinit(&decoder.conv_state);
/* flush the last chunk */
if (decoder.replay_gain != NULL)
replay_gain_info_free(decoder.replay_gain);
if (decoder.chunk != NULL)
decoder_flush_chunk(&decoder);