aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/vorbis_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-01-03 22:44:23 +0100
committerMax Kellermann <max@duempel.org>2010-01-04 20:42:49 +0100
commitcd8f92c9285e9b3b460ff47d2f251bfabce544da (patch)
tree594de0f646b0fc69405132c3a9e2f05060399abf /src/decoder/vorbis_plugin.c
parente58b4f773f28ad7b8e26c14c9c853fc2798408a1 (diff)
downloadmpd-cd8f92c9285e9b3b460ff47d2f251bfabce544da.tar.gz
mpd-cd8f92c9285e9b3b460ff47d2f251bfabce544da.tar.xz
mpd-cd8f92c9285e9b3b460ff47d2f251bfabce544da.zip
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.
Diffstat (limited to 'src/decoder/vorbis_plugin.c')
-rw-r--r--[-rwxr-xr-x]src/decoder/vorbis_plugin.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/decoder/vorbis_plugin.c b/src/decoder/vorbis_plugin.c
index 15f88c960..12a6623b2 100755..100644
--- a/src/decoder/vorbis_plugin.c
+++ b/src/decoder/vorbis_plugin.c
@@ -277,7 +277,6 @@ vorbis_stream_decode(struct decoder *decoder,
char chunk[OGG_CHUNK_SIZE];
long bitRate = 0;
long test;
- struct replay_gain_info *replay_gain_info = NULL;
const vorbis_info *vi;
enum decoder_command cmd = DECODE_COMMAND_NONE;
@@ -364,9 +363,8 @@ vorbis_stream_decode(struct decoder *decoder,
vorbis_send_comments(decoder, input_stream, comments);
new_rgi = vorbis_comments_to_replay_gain(comments);
if (new_rgi != NULL) {
- if (replay_gain_info != NULL)
- replay_gain_info_free(replay_gain_info);
- replay_gain_info = new_rgi;
+ decoder_replay_gain(decoder, new_rgi);
+ replay_gain_info_free(new_rgi);
}
prev_section = current_section;
@@ -377,12 +375,9 @@ vorbis_stream_decode(struct decoder *decoder,
cmd = decoder_data(decoder, input_stream,
chunk, ret,
- bitRate, replay_gain_info);
+ bitRate);
} while (cmd != DECODE_COMMAND_STOP);
- if (replay_gain_info)
- replay_gain_info_free(replay_gain_info);
-
ov_clear(&vf);
}