diff -Nru qtmultimedia-opensource-src-5.2.1/debian/changelog qtmultimedia-opensource-src-5.2.1/debian/changelog --- qtmultimedia-opensource-src-5.2.1/debian/changelog 2014-03-16 08:44:05.000000000 +0000 +++ qtmultimedia-opensource-src-5.2.1/debian/changelog 2014-03-16 16:37:06.000000000 +0000 @@ -1,3 +1,10 @@ +qtmultimedia-opensource-src (5.2.1-0ubuntu4) trusty; urgency=medium + + * Update the previous patch to never do duplicate endianness + conversion. + + -- Dmitry Shachnev Sun, 16 Mar 2014 20:36:22 +0400 + qtmultimedia-opensource-src (5.2.1-0ubuntu3) trusty; urgency=medium * Add new patch to support big-endian systems (a second attempt to diff -Nru qtmultimedia-opensource-src-5.2.1/debian/patches/bigendian_support.diff qtmultimedia-opensource-src-5.2.1/debian/patches/bigendian_support.diff --- qtmultimedia-opensource-src-5.2.1/debian/patches/bigendian_support.diff 2014-03-16 08:42:20.000000000 +0000 +++ qtmultimedia-opensource-src-5.2.1/debian/patches/bigendian_support.diff 2014-03-16 16:34:41.000000000 +0000 @@ -22,7 +22,15 @@ dataSize = descriptor.size; -@@ -234,6 +238,8 @@ +@@ -227,13 +231,15 @@ + bool QWaveDecoder::enoughDataAvailable() + { + chunk descriptor; +- if (!peekChunk(&descriptor)) ++ if (!peekChunk(&descriptor, false)) + return false; + + // This is only called for the RIFF/RIFX header, before bigEndian is set, // so we have to manually swizzle if (qstrncmp(descriptor.id, "RIFX", 4) == 0) descriptor.size = qFromBigEndian(descriptor.size); @@ -31,12 +39,38 @@ if (source->bytesAvailable() < qint64(sizeof(chunk) + descriptor.size)) return false; -@@ -279,6 +285,8 @@ - source->peek(reinterpret_cast(pChunk), sizeof(chunk)); - if (bigEndian) - pChunk->size = qFromBigEndian(pChunk->size); -+ else -+ pChunk->size = qFromLittleEndian(pChunk->size); +@@ -270,16 +276,18 @@ + return false; + } +-// Handles endianness +-bool QWaveDecoder::peekChunk(chunk *pChunk) ++bool QWaveDecoder::peekChunk(chunk *pChunk, bool handleEndianness) + { + if (source->bytesAvailable() < qint64(sizeof(chunk))) + return false; + + source->peek(reinterpret_cast(pChunk), sizeof(chunk)); +- if (bigEndian) +- pChunk->size = qFromBigEndian(pChunk->size); +- ++ if (handleEndianness) { ++ if (bigEndian) ++ pChunk->size = qFromBigEndian(pChunk->size); ++ else ++ pChunk->size = qFromLittleEndian(pChunk->size); ++ } return true; } + +--- a/src/multimedia/audio/qwavedecoder_p.h ++++ b/src/multimedia/audio/qwavedecoder_p.h +@@ -103,7 +103,7 @@ + char id[4]; + quint32 size; + }; +- bool peekChunk(chunk* pChunk); ++ bool peekChunk(chunk* pChunk, bool handleEndianness = true); + + struct RIFFHeader + {