aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2015-12-27 18:05:14 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2015-12-27 18:05:14 +0000
commitfb3b208b48976721954b232a8a100633e8f9c55b (patch)
treec76e1d30b7373e5a1bff345fa0df7dc8a5d95f10
parentd55e5c3b1bd791f0f579315c30bf14064eff5824 (diff)
downloadqmmp-fb3b208b48976721954b232a8a100633e8f9c55b.tar.gz
qmmp-fb3b208b48976721954b232a8a100633e8f9c55b.tar.bz2
qmmp-fb3b208b48976721954b232a8a100633e8f9c55b.zip
opus: using float output
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5919 90c681e8-e032-0410-971d-27865f9a5e38
-rw-r--r--src/plugins/Input/opus/decoder_opus.cpp9
-rw-r--r--src/plugins/Input/opus/decoder_opus.h2
2 files changed, 5 insertions, 6 deletions
diff --git a/src/plugins/Input/opus/decoder_opus.cpp b/src/plugins/Input/opus/decoder_opus.cpp
index d55b75be9..0441e944c 100644
--- a/src/plugins/Input/opus/decoder_opus.cpp
+++ b/src/plugins/Input/opus/decoder_opus.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2013-2014 by Ilya Kotov *
+ * Copyright (C) 2013-2015 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -137,7 +137,7 @@ bool DecoderOpus::initialize()
qWarning("DecoderOpus: unsupported number of channels: %d", m_chan);
return false;
}
- configure(48000, chmap, Qmmp::PCM_S16LE); //opus codec supports 48 kHz only
+ configure(48000, chmap, Qmmp::PCM_FLOAT); //opus codec supports 48 kHz only
return true;
}
@@ -160,10 +160,9 @@ void DecoderOpus::seek(qint64 time)
qint64 DecoderOpus::read(unsigned char *data, qint64 maxSize)
{
- int samples = maxSize / 2 / m_chan;
- samples = op_read(m_opusfile, (opus_int16 *)data, samples, 0);
+ int frames = op_read_float(m_opusfile, (float*) data, maxSize / sizeof(float), 0);
m_bitrate = op_bitrate_instant(m_opusfile) / 1000;
- return samples * m_chan * 2;
+ return frames * m_chan * sizeof(float);
}
//https://tools.ietf.org/id/draft-ietf-codec-oggopus-04.txt
diff --git a/src/plugins/Input/opus/decoder_opus.h b/src/plugins/Input/opus/decoder_opus.h
index e1d8a3287..f2395f347 100644
--- a/src/plugins/Input/opus/decoder_opus.h
+++ b/src/plugins/Input/opus/decoder_opus.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2013-2014 by Ilya Kotov *
+ * Copyright (C) 2013-2015 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *