diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2009-03-07 22:43:26 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2009-03-07 22:43:26 +0000 |
| commit | 0b46e2db06ec1bbfc3aee819787386ace9dad66c (patch) | |
| tree | 109f4bbf3a7227262a280f00731f0767d331a811 /src/plugins/Input/mpc/decoder_mpc.cpp | |
| parent | 5896c5ae40726637cbfc5605f5f659791ff569c7 (diff) | |
| download | qmmp-0b46e2db06ec1bbfc3aee819787386ace9dad66c.tar.gz qmmp-0b46e2db06ec1bbfc3aee819787386ace9dad66c.tar.bz2 qmmp-0b46e2db06ec1bbfc3aee819787386ace9dad66c.zip | |
improved seeking accuracy
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@827 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/mpc/decoder_mpc.cpp')
| -rw-r--r-- | src/plugins/Input/mpc/decoder_mpc.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/plugins/Input/mpc/decoder_mpc.cpp b/src/plugins/Input/mpc/decoder_mpc.cpp index 9b3679dd3..d8d739c1c 100644 --- a/src/plugins/Input/mpc/decoder_mpc.cpp +++ b/src/plugins/Input/mpc/decoder_mpc.cpp @@ -112,14 +112,10 @@ DecoderMPC::DecoderMPC(QObject *parent, DecoderFactory *d, QIODevice *i, Output freq = 0; bitrate = 0; seekTime = -1.0; - totalTime = 0.0; + m_totalTime = 0.0; chan = 0; output_size = 0; m_data = 0; - - - - } @@ -191,7 +187,7 @@ bool DecoderMPC::initialize() chan = 0; output_size = 0; seekTime = -1.0; - totalTime = 0.0; + m_totalTime = 0.0; if (!input()) @@ -242,19 +238,19 @@ bool DecoderMPC::initialize() qWarning("DecoderMPC: cannot get info."); return FALSE; } - totalTime = mpc_streaminfo_get_length(&data()->info); + m_totalTime = mpc_streaminfo_get_length(&data()->info) * 1000; inited = TRUE; qDebug("DecoderMPC: initialize succes"); return TRUE; } -qint64 DecoderMPC::lengthInSeconds() +qint64 DecoderMPC::totalTime() { if (! inited) return 0; - return totalTime; + return m_totalTime; } @@ -292,7 +288,7 @@ void DecoderMPC::run() if (seekTime >= 0.0) { - mpc_decoder_seek_seconds(&data()->decoder, seekTime); + mpc_decoder_seek_seconds(&data()->decoder, seekTime/1000); seekTime = -1.0; } MPC_SAMPLE_FORMAT buffer[MPC_DECODER_BUFFER_LENGTH]; |
