summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-07-21 22:28:15 +0100
committerCarl Hetherington <cth@carlh.net>2015-07-21 22:28:15 +0100
commitde5037c6ec1a33d17bd0a6029676f8fd39f55b41 (patch)
tree923545731a28ccc0e5d2c36ede1c6977560d2305
parent3dd20a9131a08bda5f31ee0596573f4c5013c4d8 (diff)
Fix incorrect conversion of audio from DCP sources (#642).
-rw-r--r--ChangeLog4
-rw-r--r--src/lib/dcp_decoder.cc2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 40b78743c..fd0466ffc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-07-21 Carl Hetherington <cth@carlh.net>
+
+ * Fix incorrect conversion of audio from DCP sources (#642).
+
2015-07-20 Carl Hetherington <cth@carlh.net>
* Version 2.1.26 released.
diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc
index 531a33c03..44450f7d9 100644
--- a/src/lib/dcp_decoder.cc
+++ b/src/lib/dcp_decoder.cc
@@ -96,7 +96,7 @@ DCPDecoder::pass ()
shared_ptr<AudioBuffers> data (new AudioBuffers (channels, frames));
for (int i = 0; i < frames; ++i) {
for (int j = 0; j < channels; ++j) {
- data->data()[j][i] = float (from[0] | (from[1] << 8) | (from[2] << 16)) / (1 << 23);
+ data->data()[j][i] = static_cast<int> ((from[0] << 8) | (from[1] << 16) | (from[2] << 24)) / static_cast<float> (INT_MAX - 256);
from += 3;
}
}