diff options
author | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:05 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:05 +0200 |
commit | 0d8b551c5a3aeadfd6901469946078d5a95ecb42 (patch) | |
tree | 3fd36e06ef46dfcfc7f9e426b42668318aec8d59 /src/inputPlugins/oggvorbis_plugin.c | |
parent | 4590a98f0eb9484e185e7e0c25a3373c8e9076ea (diff) | |
download | mpd-0d8b551c5a3aeadfd6901469946078d5a95ecb42.tar.gz mpd-0d8b551c5a3aeadfd6901469946078d5a95ecb42.tar.xz mpd-0d8b551c5a3aeadfd6901469946078d5a95ecb42.zip |
added parameter total_time to decoder_initialized()
Similar to the previous patch: pass total_time instead of manipulating
dc->totalTime directly.
Diffstat (limited to 'src/inputPlugins/oggvorbis_plugin.c')
-rw-r--r-- | src/inputPlugins/oggvorbis_plugin.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/inputPlugins/oggvorbis_plugin.c b/src/inputPlugins/oggvorbis_plugin.c index 2fb0a9e52..e53e27de7 100644 --- a/src/inputPlugins/oggvorbis_plugin.c +++ b/src/inputPlugins/oggvorbis_plugin.c @@ -262,9 +262,6 @@ static int oggvorbis_decode(struct decoder * decoder, InputStream * inStream) } return 0; } - dc.totalTime = ov_time_total(&vf, -1); - if (dc.totalTime < 0) - dc.totalTime = 0; audio_format.bits = 16; while (1) { @@ -285,7 +282,11 @@ static int oggvorbis_decode(struct decoder * decoder, InputStream * inStream) audio_format.channels = vi->channels; audio_format.sampleRate = vi->rate; if (dc.state == DECODE_STATE_START) { - decoder_initialized(decoder, &audio_format); + float total_time = ov_time_total(&vf, -1); + if (total_time < 0) + total_time = 0; + decoder_initialized(decoder, &audio_format, + total_time); } comments = ov_comment(&vf, -1)->user_comments; putOggCommentsIntoOutputBuffer(inStream->metaName, |