From cd8f92c9285e9b3b460ff47d2f251bfabce544da Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 3 Jan 2010 22:44:23 +0100 Subject: 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. --- src/decoder/vorbis_plugin.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) mode change 100755 => 100644 src/decoder/vorbis_plugin.c (limited to 'src/decoder/vorbis_plugin.c') diff --git a/src/decoder/vorbis_plugin.c b/src/decoder/vorbis_plugin.c old mode 100755 new mode 100644 index 15f88c960..12a6623b2 --- 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); } -- cgit v1.2.3