diff options
author | 2009-09-27 16:06:47 +0200 | |
---|---|---|
committer | 2009-09-27 16:06:47 +0200 | |
commit | 40cdc329bac46ee7ea0ce6d6a4c0b9ea69e2cf2d (patch) | |
tree | d39bb12b8a24ce501792d3937ca5eca8ca154632 /plugins | |
parent | 3047be34234d90bbdbbe6239ef4e16c526bfd866 (diff) |
minor fixes in flac and vorbis
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/flac/flac.c | 1 | ||||
-rw-r--r-- | plugins/vorbis/vorbis.c | 6 |
2 files changed, 2 insertions, 5 deletions
diff --git a/plugins/flac/flac.c b/plugins/flac/flac.c index ad6aab10..5184c5fa 100644 --- a/plugins/flac/flac.c +++ b/plugins/flac/flac.c @@ -170,7 +170,6 @@ cflac_init (DB_playItem_t *it) { currentsample = 0; trace ("startsample=%d, endsample=%d, totalsamples=%d\n", startsample, endsample, cb.totalsamples); } - plugin.info.readpos = 0; remaining = 0; return 0; diff --git a/plugins/vorbis/vorbis.c b/plugins/vorbis/vorbis.c index b854356a..26cd3051 100644 --- a/plugins/vorbis/vorbis.c +++ b/plugins/vorbis/vorbis.c @@ -38,8 +38,6 @@ static FILE *file; static OggVorbis_File vorbis_file; static vorbis_info *vi; static int cur_bit_stream; -static float timestart; -static float timeend; static int startsample; static int endsample; static int currentsample; @@ -128,7 +126,7 @@ cvorbis_read (char *bytes, int size) { break; } } - plugin.info.readpos = ov_time_tell(&vorbis_file) - timestart; + plugin.info.readpos = (float)(ov_pcm_tell(&vorbis_file)-startsample)/vi->rate; return initsize - size; } @@ -146,7 +144,7 @@ cvorbis_seek_sample (int sample) { fprintf (stderr, "oggvorbis: failed to do sample-accurate seek (%d->%d)\n", sample, tell); } currentsample = sample; - plugin.info.readpos = ov_time_tell(&vorbis_file) - timestart; + plugin.info.readpos = (float)(ov_pcm_tell(&vorbis_file) - startsample)/vi->rate; return 0; } |