diff options
Diffstat (limited to 'src/plugins/Input/sndfile')
| -rw-r--r-- | src/plugins/Input/sndfile/decoder_sndfile.cpp | 8 | ||||
| -rw-r--r-- | src/plugins/Input/sndfile/decoder_sndfile.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/Input/sndfile/decoder_sndfile.cpp b/src/plugins/Input/sndfile/decoder_sndfile.cpp index 4568a2fd9..9152913fe 100644 --- a/src/plugins/Input/sndfile/decoder_sndfile.cpp +++ b/src/plugins/Input/sndfile/decoder_sndfile.cpp @@ -133,9 +133,9 @@ bool DecoderSndFile::initialize() m_freq = snd_info.samplerate; m_chan = snd_info.channels; - m_totalTime = (double) snd_info.frames / m_freq; + m_totalTime = snd_info.frames * 1000 / m_freq; - m_bitrate = QFileInfo(m_path).size () * 8.0 / m_totalTime / 1000.0 + 0.5; + m_bitrate = QFileInfo(m_path).size () * 8.0 / m_totalTime + 0.5; configure(m_freq, m_chan, 16); m_buf = new short[bks / sizeof(short)]; @@ -146,7 +146,7 @@ bool DecoderSndFile::initialize() } -qint64 DecoderSndFile::lengthInSeconds() +qint64 DecoderSndFile::totalTime() { if (! m_inited) return 0; @@ -196,7 +196,7 @@ void DecoderSndFile::run() if (m_seekTime >= 0) { - m_output_size = sf_seek(m_sndfile, m_freq*m_seekTime, SEEK_SET); + m_output_size = sf_seek(m_sndfile, m_freq*m_seekTime/1000, SEEK_SET); m_seekTime = -1.0; } diff --git a/src/plugins/Input/sndfile/decoder_sndfile.h b/src/plugins/Input/sndfile/decoder_sndfile.h index e221065f2..c62544193 100644 --- a/src/plugins/Input/sndfile/decoder_sndfile.h +++ b/src/plugins/Input/sndfile/decoder_sndfile.h @@ -35,7 +35,7 @@ public: // Standard Decoder API bool initialize(); - qint64 lengthInSeconds(); + qint64 totalTime(); void seek(qint64); void stop(); |
