aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-07-20 18:02:12 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-07-20 18:02:12 +0000
commit411a6c40f71b28328262a195935c5f94f3584d8e (patch)
treed23f93901ae1a9618d316c4f439bc0dbbe552495 /src
parent136ed47dafbd60544add69a7f2d720b7929bd83e (diff)
downloadqmmp-411a6c40f71b28328262a195935c5f94f3584d8e.tar.gz
qmmp-411a6c40f71b28328262a195935c5f94f3584d8e.tar.bz2
qmmp-411a6c40f71b28328262a195935c5f94f3584d8e.zip
enabled wavpack plugin, fixed problem with slow seeking
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1053 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
-rw-r--r--src/plugins/Input/CMakeLists.txt4
-rw-r--r--src/plugins/Input/Input.pro2
-rw-r--r--src/plugins/Input/wavpack/cueparser.cpp6
-rw-r--r--src/plugins/Input/wavpack/decoder_wavpack.cpp255
-rw-r--r--src/plugins/Input/wavpack/decoder_wavpack.h37
-rw-r--r--src/plugins/Input/wavpack/translations/wavpack_plugin_cs.ts11
-rw-r--r--src/plugins/Input/wavpack/translations/wavpack_plugin_de.ts9
-rw-r--r--src/plugins/Input/wavpack/translations/wavpack_plugin_it.ts9
-rw-r--r--src/plugins/Input/wavpack/translations/wavpack_plugin_ru.ts11
-rw-r--r--src/plugins/Input/wavpack/translations/wavpack_plugin_uk_UA.ts11
-rw-r--r--src/plugins/Input/wavpack/translations/wavpack_plugin_zh_CN.ts12
-rw-r--r--src/plugins/Input/wavpack/translations/wavpack_plugin_zh_TW.ts12
-rw-r--r--src/qmmp/decoder.cpp7
13 files changed, 156 insertions, 230 deletions
diff --git a/src/plugins/Input/CMakeLists.txt b/src/plugins/Input/CMakeLists.txt
index fe3909cb9..214dfed1f 100644
--- a/src/plugins/Input/CMakeLists.txt
+++ b/src/plugins/Input/CMakeLists.txt
@@ -21,7 +21,7 @@ add_subdirectory(mad)
ENDIF(USE_MAD AND TAGLIB_FOUND)
IF(USE_FLAC AND TAGLIB_FOUND)
-#add_subdirectory(flac)
+add_subdirectory(flac)
ENDIF(USE_FLAC AND TAGLIB_FOUND)
IF(USE_VORBIS AND TAGLIB_FOUND)
@@ -41,7 +41,7 @@ add_subdirectory(sndfile)
ENDIF(USE_SNDFILE)
IF(USE_WAVPACK)
-#add_subdirectory(wavpack)
+add_subdirectory(wavpack)
ENDIF(USE_WAVPACK)
IF(USE_MODPLUG)
diff --git a/src/plugins/Input/Input.pro b/src/plugins/Input/Input.pro
index 1f31ec065..2aff50c64 100644
--- a/src/plugins/Input/Input.pro
+++ b/src/plugins/Input/Input.pro
@@ -4,7 +4,7 @@ SUBDIRS += mad cue
TEMPLATE = subdirs
unix{
-SUBDIRS += vorbis sndfile #wavpack
+SUBDIRS += vorbis sndfile wavpack
contains(CONFIG, MODPLUG_PLUGIN){
#SUBDIRS += modplug
message(***************************)
diff --git a/src/plugins/Input/wavpack/cueparser.cpp b/src/plugins/Input/wavpack/cueparser.cpp
index db837c427..1130639d1 100644
--- a/src/plugins/Input/wavpack/cueparser.cpp
+++ b/src/plugins/Input/wavpack/cueparser.cpp
@@ -69,10 +69,10 @@ CUEParser::CUEParser(const QByteArray &array, const QString &fileName)
}
else if (words[0] == "INDEX")
{
- if (m_infoList.isEmpty())
+ if (m_infoList.isEmpty() || words[1] != "01")
continue;
- m_infoList.last ().setLength(getLength(words[2]));
- m_offsets.last() = getLength(words[2]);
+ m_infoList.last ().setLength(getLength(words[2]));
+ m_offsets.last() = getLength(words[2]);
}
else if (words[0] == "REM")
{
diff --git a/src/plugins/Input/wavpack/decoder_wavpack.cpp b/src/plugins/Input/wavpack/decoder_wavpack.cpp
index 6753f2d47..4a8900011 100644
--- a/src/plugins/Input/wavpack/decoder_wavpack.cpp
+++ b/src/plugins/Input/wavpack/decoder_wavpack.cpp
@@ -25,7 +25,6 @@
#include <math.h>
#include <stdint.h>
-#include <qmmp/constants.h>
#include <qmmp/buffer.h>
#include <qmmp/output.h>
#include <qmmp/recycler.h>
@@ -40,23 +39,12 @@ DecoderWavPack::DecoderWavPack(QObject *parent, DecoderFactory *d, Output *o, co
: Decoder(parent, d, o)
{
m_path = path;
- m_inited = FALSE;
- m_user_stop = FALSE;
- m_output_buf = 0;
- m_output_bytes = 0;
- m_output_at = 0;
- m_bks = 0;
- m_done = FALSE;
- m_finish = FALSE;
- m_freq = 0;
- m_bitrate = 0;
- m_seekTime = -1.0;
m_totalTime = 0.0;
m_chan = 0;
- m_output_size = 0;
m_context = 0;
- m_length = 0;
- m_offset = 0;
+ m_freq = 0;
+ m_cue_parser = 0;
+ m_output_buf = 0;
}
DecoderWavPack::~DecoderWavPack()
@@ -67,64 +55,10 @@ DecoderWavPack::~DecoderWavPack()
m_output_buf = 0;
}
-void DecoderWavPack::stop()
-{
- m_user_stop = TRUE;
-}
-
-void DecoderWavPack::flush(bool final)
-{
- ulong min = final ? 0 : m_bks;
-
- while ((! m_done && ! m_finish) && m_output_bytes > min)
- {
- output()->recycler()->mutex()->lock ();
-
- while ((! m_done && ! m_finish) && output()->recycler()->full())
- {
- mutex()->unlock();
-
- output()->recycler()->cond()->wait(output()->recycler()->mutex());
-
- mutex()->lock ();
- m_done = m_user_stop;
- }
-
- if (m_user_stop || m_finish)
- {
- m_inited = FALSE;
- m_done = TRUE;
- }
- else
- {
- m_output_bytes -= produceSound(m_output_buf, m_output_bytes, m_bitrate, m_chan);
- m_output_size += m_bks;
- m_output_at = m_output_bytes;
- }
-
- if (output()->recycler()->full())
- {
- output()->recycler()->cond()->wakeOne();
- }
-
- output()->recycler()->mutex()->unlock();
- }
-}
-
bool DecoderWavPack::initialize()
{
- m_bks = Buffer::size();
- m_inited = m_user_stop = m_done = m_finish = FALSE;
- m_freq = m_bitrate = 0;
m_chan = 0;
- m_output_size = 0;
- m_seekTime = -1.0;
- m_totalTime = 0.0;
-
- if (! m_output_buf)
- m_output_buf = new char[globalBufferSize];
- m_output_at = 0;
- m_output_bytes = 0;
+ m_totalTime = 0;
char err [80];
if (m_path.startsWith("wvpack://")) //embeded cue track
@@ -139,20 +73,28 @@ bool DecoderWavPack::initialize()
{
value = (char*)malloc (cue_len * 2 + 1);
WavpackGetTagItem (m_context, "cuesheet", value, cue_len + 1);
- CUEParser parser(value, p);
+ m_cue_parser = new CUEParser(value, p);
int track = m_path.section("#", -1).toInt();
- m_offset = parser.offset(track);
- m_length = parser.length(track);
+ if(track > m_cue_parser->count())
+ {
+ qWarning("DecoderWavPack: invalid cuesheet comment");
+ return FALSE;
+ }
m_path = p;
//send metadata
- QMap<Qmmp::MetaData, QString> metaData = parser.info(track)->metaData();
+ QMap<Qmmp::MetaData, QString> metaData = m_cue_parser->info(track)->metaData();
StateHandler::instance()->dispatch(metaData);
+ connect(stateHandler(),SIGNAL(aboutToFinish()),SLOT(processFinish()));
+ //next url
+ m_nextUrl.clear();
+ if(track <= m_cue_parser->count() - 1)
+ m_nextUrl = m_cue_parser->info(track + 1)->path();
+ m_totalTime = m_cue_parser->length(track);
+ setFragment(m_cue_parser->offset(track), m_cue_parser->length(track));
}
}
else
- {
m_context = WavpackOpenFileInput (m_path.toLocal8Bit(), err, OPEN_WVC | OPEN_TAGS, 0);
- }
if (!m_context)
{
@@ -162,140 +104,81 @@ bool DecoderWavPack::initialize()
m_chan = WavpackGetNumChannels(m_context);
m_freq = WavpackGetSampleRate (m_context);
- m_bps = WavpackGetBitsPerSample (m_context);
- configure(m_freq, m_chan, m_bps);
- m_inited = TRUE;
-
- if (m_offset)
- m_seekTime = m_offset;
- if (m_length)
- m_totalTime = m_length;
- else
+ int bps = WavpackGetBitsPerSample (m_context);
+ if (!m_output_buf)
+ m_output_buf = new int32_t[Qmmp::globalBufferSize()/4];
+ configure(m_freq, m_chan, bps);
+ if(!m_cue_parser)
m_totalTime = (qint64) WavpackGetNumSamples(m_context) * 1000 / m_freq;
qDebug("DecoderWavPack: initialize succes");
return TRUE;
}
-qint64 DecoderWavPack::totalTime()
+int DecoderWavPack::bitrate()
{
- if (!m_inited)
- return 0;
-
- return m_totalTime;
+ if(m_context)
+ return int(WavpackGetInstantBitrate(m_context)/1000);
+ return 0;
}
-
-void DecoderWavPack::seek(qint64 pos)
+qint64 DecoderWavPack::totalTime()
{
- m_seekTime = pos + m_offset;
+ return m_totalTime;
}
void DecoderWavPack::deinit()
{
- m_inited = m_user_stop = m_done = m_finish = FALSE;
- m_freq = m_bitrate = 0;
m_chan = 0;
- m_output_size = 0;
- m_length = 0;
- m_offset = 0;
+ m_freq = 0;
if (m_context)
- {
WavpackCloseFile (m_context);
- m_context = 0;
- }
+ m_context = 0;
+ if(m_cue_parser)
+ delete m_cue_parser;
+ m_cue_parser = 0;
}
-void DecoderWavPack::run()
+void DecoderWavPack::seekAudio(qint64 time)
{
- mutex()->lock ();
-
- ulong len = 0;
- int32_t *in = new int32_t[globalBufferSize * m_chan / m_chan / 4];
- int16_t *out = new int16_t[globalBufferSize * m_chan / m_chan / 4];
- uint32_t samples = 0;
+ WavpackSeekSample (m_context, time * m_freq / 1000);
+}
- if (!m_inited)
+qint64 DecoderWavPack::readAudio(char *data, qint64 maxSize)
+{
+ ulong len = WavpackUnpackSamples (m_context, m_output_buf, maxSize / m_chan / 4);
+ uint m = 0;
+ //convert 32 to 16
+ for (uint i = 0; i < len * m_chan; ++i)
{
- mutex()->unlock();
- return;
+ data[m++] = (m_output_buf[i] >> 0) & 0xff;
+ data[m++] = (m_output_buf[i] >> 8) & 0xff;
}
- mutex()->unlock();
+ return len * m_chan * 2;
+}
- while (! m_done && ! m_finish)
+void DecoderWavPack::processFinish()
+{
+ if(m_cue_parser && nextUrlRequest(m_nextUrl))
{
- mutex()->lock ();
-
- //seeking
- if (m_seekTime >= 0.0)
- {
- WavpackSeekSample (m_context, m_seekTime * m_freq / 1000);
- m_seekTime = -1.0;
- }
- //stop if track ended
- if ((qint64) WavpackGetSampleIndex(m_context) * 1000 /m_freq - m_offset >= m_totalTime)
- {
- m_finish = TRUE;
- }
-
- samples = (globalBufferSize-m_output_at)/m_chan/4;
-
- len = WavpackUnpackSamples (m_context, in, samples);
- for (ulong i = 0; i < len * m_chan; ++i)
- out[i] = in[i];
-
- len *= (m_chan * 2); //convert to number of bytes
- memcpy(m_output_buf + m_output_at, (char *) out, len);
- if (len > 0)
- {
- m_bitrate =int( WavpackGetInstantBitrate(m_context)/1000);
- m_output_at += len;
- m_output_bytes += len;
-
- if (output())
- flush();
-
- }
- else if (len == 0)
- {
- flush(TRUE);
-
- if (output())
- {
- output()->recycler()->mutex()->lock ();
- // end of stream
- while (! output()->recycler()->empty() && ! m_user_stop)
- {
- output()->recycler()->cond()->wakeOne();
- mutex()->unlock();
- output()->recycler()->cond()->wait(output()->recycler()->mutex());
- mutex()->lock ();
- }
- output()->recycler()->mutex()->unlock();
- }
-
- m_done = TRUE;
- if (! m_user_stop)
- {
- m_finish = TRUE;
- }
- }
- else
- {
- // error while reading
- qWarning("DecoderWavPack: Error while decoding stream, file appears to be corrupted");
- m_finish = TRUE;
- }
+ qDebug("DecoderFLAC: going to next track");
+ int track = m_nextUrl.section("#", -1).toInt();
+ QString p = QUrl(m_nextUrl).path();
+ p.replace(QString(QUrl::toPercentEncoding("#")), "#");
+ p.replace(QString(QUrl::toPercentEncoding("%")), "%");
+ //update current fragment
+ mutex()->lock();
+ setFragment(m_cue_parser->offset(track), m_cue_parser->length(track));
+ m_totalTime = m_cue_parser->length(track);
+ output()->seek(0); //reset time counter
mutex()->unlock();
+ // find next track
+ m_nextUrl.clear();
+ if(track <= m_cue_parser->count() - 1)
+ m_nextUrl = m_cue_parser->info(track + 1)->path();
+ //change track
+ emit playbackFinished();
+ //send metadata
+ QMap<Qmmp::MetaData, QString> metaData = m_cue_parser->info(track)->metaData();
+ stateHandler()->dispatch(metaData);
}
-
- mutex()->lock ();
-
- delete[] in;
- delete[] out;
-
- if (m_finish)
- finish();
-
- mutex()->unlock();
- deinit();
}
diff --git a/src/plugins/Input/wavpack/decoder_wavpack.h b/src/plugins/Input/wavpack/decoder_wavpack.h
index fe2a0a092..a6704abc2 100644
--- a/src/plugins/Input/wavpack/decoder_wavpack.h
+++ b/src/plugins/Input/wavpack/decoder_wavpack.h
@@ -24,12 +24,13 @@
extern "C"{
#include <wavpack/wavpack.h>
}
-
#include <qmmp/decoder.h>
+class CUEParser;
class DecoderWavPack : public Decoder
{
+Q_OBJECT
public:
DecoderWavPack(QObject *, DecoderFactory *, Output *, const QString &);
virtual ~DecoderWavPack();
@@ -37,33 +38,25 @@ public:
// Standard Decoder API
bool initialize();
qint64 totalTime();
- void seek(qint64);
- void stop();
+ int bitrate();
+
+private slots:
+ void processFinish();
private:
- // thread run function
- void run();
- WavpackContext *m_context;
+ // Standard Decoder API
+ qint64 readAudio(char *data, qint64 maxSize);
+ void seekAudio(qint64 time);
// helper functions
- void flush(bool = FALSE);
void deinit();
-
- bool m_inited, m_user_stop;
- int m_bps; //bits per sample
-
+ WavpackContext *m_context;
// output buffer
- char *m_output_buf;
- qint64 m_output_bytes, m_output_at;
-
- unsigned int m_bks; //block size
- bool m_done, m_finish;
- long m_freq, m_bitrate;
+ int32_t *m_output_buf;
int m_chan;
- qint64 m_output_size;
- qint64 m_totalTime, m_seekTime;
- QString m_path;
- qint64 m_offset;
- qint64 m_length;
+ quint32 m_freq;
+ qint64 m_totalTime;
+ QString m_path, m_nextUrl;
+ CUEParser *m_cue_parser;
};
#endif // DECODER_WAVPACK_H
diff --git a/src/plugins/Input/wavpack/translations/wavpack_plugin_cs.ts b/src/plugins/Input/wavpack/translations/wavpack_plugin_cs.ts
index ba8773da1..eea901fb1 100644
--- a/src/plugins/Input/wavpack/translations/wavpack_plugin_cs.ts
+++ b/src/plugins/Input/wavpack/translations/wavpack_plugin_cs.ts
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="1.1" language="cs">
+<!DOCTYPE TS>
+<TS version="2.0" language="cs">
<context>
<name>DecoderWavPackFactory</name>
<message>
@@ -18,7 +19,7 @@
<translation>Vstupní modul Qmmp WavPack</translation>
</message>
<message>
- <location filename="../decoderwavpackfactory.cpp" line="132"/>
+ <location filename="../decoderwavpackfactory.cpp" line="131"/>
<source>WavPack library version:</source>
<translation>Verze knihovny WavPack:</translation>
</message>
@@ -66,6 +67,12 @@
<translation>Cesta k souboru:</translation>
</message>
<message>
+ <location filename="../detailsdialog.ui" line="58"/>
+ <location filename="../detailsdialog.ui" line="75"/>
+ <location filename="../detailsdialog.ui" line="92"/>
+ <location filename="../detailsdialog.ui" line="118"/>
+ <location filename="../detailsdialog.ui" line="135"/>
+ <location filename="../detailsdialog.ui" line="152"/>
<location filename="../detailsdialog.ui" line="169"/>
<source>-</source>
<translation>-</translation>
diff --git a/src/plugins/Input/wavpack/translations/wavpack_plugin_de.ts b/src/plugins/Input/wavpack/translations/wavpack_plugin_de.ts
index 41a3256a4..406949a47 100644
--- a/src/plugins/Input/wavpack/translations/wavpack_plugin_de.ts
+++ b/src/plugins/Input/wavpack/translations/wavpack_plugin_de.ts
@@ -9,7 +9,6 @@
<translation>WavPack-Modul</translation>
</message>
<message>
- <location filename="../decoderwavpackfactory.cpp" line="30"/>
<source>WavPackk Files</source>
<translation type="obsolete">WavPack Dateien</translation>
</message>
@@ -24,7 +23,7 @@
<translation>Qmmp WavPack-Audio-Modul</translation>
</message>
<message>
- <location filename="../decoderwavpackfactory.cpp" line="132"/>
+ <location filename="../decoderwavpackfactory.cpp" line="131"/>
<source>WavPack library version:</source>
<translation>WavPack-Bibliotheksversion:</translation>
</message>
@@ -77,6 +76,12 @@
<translation>Länge:</translation>
</message>
<message>
+ <location filename="../detailsdialog.ui" line="58"/>
+ <location filename="../detailsdialog.ui" line="75"/>
+ <location filename="../detailsdialog.ui" line="92"/>
+ <location filename="../detailsdialog.ui" line="118"/>
+ <location filename="../detailsdialog.ui" line="135"/>
+ <location filename="../detailsdialog.ui" line="152"/>
<location filename="../detailsdialog.ui" line="169"/>
<source>-</source>
<translation>-</translation>
diff --git a/src/plugins/Input/wavpack/translations/wavpack_plugin_it.ts b/src/plugins/Input/wavpack/translations/wavpack_plugin_it.ts
index 32b438aa7..8a023ecc6 100644
--- a/src/plugins/Input/wavpack/translations/wavpack_plugin_it.ts
+++ b/src/plugins/Input/wavpack/translations/wavpack_plugin_it.ts
@@ -9,7 +9,6 @@
<translation>Modulo WavPack</translation>
</message>
<message>
- <location filename="../decoderwavpackfactory.cpp" line="30"/>
<source>WavPackk Files</source>
<translation type="obsolete">Brani WavPack</translation>
</message>
@@ -24,7 +23,7 @@
<translation>Modulo audio WavPack per Qmmp</translation>
</message>
<message>
- <location filename="../decoderwavpackfactory.cpp" line="132"/>
+ <location filename="../decoderwavpackfactory.cpp" line="131"/>
<source>WavPack library version:</source>
<translation>Versione libreria per WavPack:</translation>
</message>
@@ -77,6 +76,12 @@
<translation>Durata:</translation>
</message>
<message>
+ <location filename="../detailsdialog.ui" line="58"/>
+ <location filename="../detailsdialog.ui" line="75"/>
+ <location filename="../detailsdialog.ui" line="92"/>
+ <location filename="../detailsdialog.ui" line="118"/>
+ <location filename="../detailsdialog.ui" line="135"/>
+ <location filename="../detailsdialog.ui" line="152"/>
<location filename="../detailsdialog.ui" line="169"/>
<source>-</source>
<translation>-</translation>
diff --git a/src/plugins/Input/wavpack/translations/wavpack_plugin_ru.ts b/src/plugins/Input/wavpack/translations/wavpack_plugin_ru.ts
index 5ac1d7e46..ba8dc4d33 100644
--- a/src/plugins/Input/wavpack/translations/wavpack_plugin_ru.ts
+++ b/src/plugins/Input/wavpack/translations/wavpack_plugin_ru.ts
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="1.1" language="pl">
+<!DOCTYPE TS>
+<TS version="2.0" language="pl">
<context>
<name>DecoderWavPackFactory</name>
<message>
@@ -23,7 +24,7 @@
<translation>Аудио-модуль WavPack для Qmmp</translation>
</message>
<message>
- <location filename="../decoderwavpackfactory.cpp" line="132"/>
+ <location filename="../decoderwavpackfactory.cpp" line="131"/>
<source>WavPack library version:</source>
<translation>Версия библиотеки WavPack:</translation>
</message>
@@ -71,6 +72,12 @@
<translation>Длительность:</translation>
</message>
<message>
+ <location filename="../detailsdialog.ui" line="58"/>
+ <location filename="../detailsdialog.ui" line="75"/>
+ <location filename="../detailsdialog.ui" line="92"/>
+ <location filename="../detailsdialog.ui" line="118"/>
+ <location filename="../detailsdialog.ui" line="135"/>
+ <location filename="../detailsdialog.ui" line="152"/>
<location filename="../detailsdialog.ui" line="169"/>
<source>-</source>
<translation type="unfinished"></translation>
diff --git a/src/plugins/Input/wavpack/translations/wavpack_plugin_uk_UA.ts b/src/plugins/Input/wavpack/translations/wavpack_plugin_uk_UA.ts
index 5d6e9ba73..d53411cde 100644
--- a/src/plugins/Input/wavpack/translations/wavpack_plugin_uk_UA.ts
+++ b/src/plugins/Input/wavpack/translations/wavpack_plugin_uk_UA.ts
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="1.1" language="uk">
+<!DOCTYPE TS>
+<TS version="2.0" language="uk">
<context>
<name>DecoderWavPackFactory</name>
<message>
@@ -23,7 +24,7 @@
<translation>Аудіо-модуль WavPack для Qmmp</translation>
</message>
<message>
- <location filename="../decoderwavpackfactory.cpp" line="132"/>
+ <location filename="../decoderwavpackfactory.cpp" line="131"/>
<source>WavPack library version:</source>
<translation>Версія бібліотеки WavPack:</translation>
</message>
@@ -71,6 +72,12 @@
<translation>Тривалість:</translation>
</message>
<message>
+ <location filename="../detailsdialog.ui" line="58"/>
+ <location filename="../detailsdialog.ui" line="75"/>
+ <location filename="../detailsdialog.ui" line="92"/>
+ <location filename="../detailsdialog.ui" line="118"/>
+ <location filename="../detailsdialog.ui" line="135"/>
+ <location filename="../detailsdialog.ui" line="152"/>
<location filename="../detailsdialog.ui" line="169"/>
<source>-</source>
<translation>-</translation>
diff --git a/src/plugins/Input/wavpack/translations/wavpack_plugin_zh_CN.ts b/src/plugins/Input/wavpack/translations/wavpack_plugin_zh_CN.ts
index 2c4792934..5f762ff57 100644
--- a/src/plugins/Input/wavpack/translations/wavpack_plugin_zh_CN.ts
+++ b/src/plugins/Input/wavpack/translations/wavpack_plugin_zh_CN.ts
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="1.1" language="zh_CN">
+<!DOCTYPE TS>
+<TS version="2.0" language="zh_CN">
<context>
<name>DecoderWavPackFactory</name>
<message>
@@ -8,7 +9,6 @@
<translation>WavPack 插件</translation>
</message>
<message>
- <location filename="../decoderwavpackfactory.cpp" line="30"/>
<source>WavPackk Files</source>
<translation type="obsolete">WavPackk 文件</translation>
</message>
@@ -23,7 +23,7 @@
<translation>Qmmp WavPack 音频插件</translation>
</message>
<message>
- <location filename="../decoderwavpackfactory.cpp" line="132"/>
+ <location filename="../decoderwavpackfactory.cpp" line="131"/>
<source>WavPack library version:</source>
<translation>WavPack 库版本:</translation>
</message>
@@ -76,6 +76,12 @@
<translation>长度:</translation>
</message>
<message>
+ <location filename="../detailsdialog.ui" line="58"/>
+ <location filename="../detailsdialog.ui" line="75"/>
+ <location filename="../detailsdialog.ui" line="92"/>
+ <location filename="../detailsdialog.ui" line="118"/>
+ <location filename="../detailsdialog.ui" line="135"/>
+ <location filename="../detailsdialog.ui" line="152"/>
<location filename="../detailsdialog.ui" line="169"/>
<source>-</source>
<translation>-</translation>
diff --git a/src/plugins/Input/wavpack/translations/wavpack_plugin_zh_TW.ts b/src/plugins/Input/wavpack/translations/wavpack_plugin_zh_TW.ts
index 53d5736e9..90a653e5d 100644
--- a/src/plugins/Input/wavpack/translations/wavpack_plugin_zh_TW.ts
+++ b/src/plugins/Input/wavpack/translations/wavpack_plugin_zh_TW.ts
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="1.1" language="zh_TW">
+<!DOCTYPE TS>
+<TS version="2.0" language="zh_TW">
<context>
<name>DecoderWavPackFactory</name>
<message>
@@ -8,7 +9,6 @@
<translation>WavPack 插件</translation>
</message>
<message>
- <location filename="../decoderwavpackfactory.cpp" line="30"/>
<source>WavPackk Files</source>
<translation type="obsolete">WavPackk 檔案</translation>
</message>
@@ -23,7 +23,7 @@
<translation>Qmmp WavPack 聲訊插件</translation>
</message>
<message>
- <location filename="../decoderwavpackfactory.cpp" line="132"/>
+ <location filename="../decoderwavpackfactory.cpp" line="131"/>
<source>WavPack library version:</source>
<translation>WavPack 程式庫版本:</translation>
</message>
@@ -76,6 +76,12 @@
<translation>長度:</translation>
</message>
<message>
+ <location filename="../detailsdialog.ui" line="58"/>
+ <location filename="../detailsdialog.ui" line="75"/>
+ <location filename="../detailsdialog.ui" line="92"/>
+ <location filename="../detailsdialog.ui" line="118"/>
+ <location filename="../detailsdialog.ui" line="135"/>
+ <location filename="../detailsdialog.ui" line="152"/>
<location filename="../detailsdialog.ui" line="169"/>
<source>-</source>
<translation>-</translation>
diff --git a/src/qmmp/decoder.cpp b/src/qmmp/decoder.cpp
index f6a9b95f9..357aff49c 100644
--- a/src/qmmp/decoder.cpp
+++ b/src/qmmp/decoder.cpp
@@ -363,6 +363,13 @@ void Decoder::flush(bool final)
while ((!_m_done && !_m_finish) && _m_output_at > min)
{
output()->recycler()->mutex()->lock ();
+ if(_m_seekTime >= 0)
+ {
+ output()->recycler()->clear();
+ output()->recycler()->mutex()->unlock ();
+ _m_output_at = 0;
+ break;
+ }
while ((!_m_done && !_m_finish) && output()->recycler()->full())
{
mutex()->unlock();