summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Yves Avenard <jyavenard@mythtv.org>2010-12-01 03:25:35 (GMT)
committer Jean-Yves Avenard <jyavenard@mythtv.org>2010-12-01 03:25:35 (GMT)
commit4d4abe51fe8b1d864b5ff68b94481653479e7fe9 (patch)
treef66290e22a19f7480ebaf6a608c62dd15baa3480
parent8e616b4538b241fc0f905c30f7e94c530b0c4836 (diff)
Backport [27370],[27375],[27377]. Fixes #6569 temporarily
git-svn-id: http://svn.mythtv.org/svn/branches/release-0-24-fixes@27395 7dbf422c-18fa-0310-86e9-fd20926502f2
-rw-r--r--mythtv/libs/libmyth/audiooutpututil.cpp13
-rw-r--r--mythtv/libs/libmyth/audiooutpututil.h3
-rw-r--r--mythtv/libs/libmythtv/avformatdecoder.cpp5
3 files changed, 20 insertions, 1 deletions
diff --git a/mythtv/libs/libmyth/audiooutpututil.cpp b/mythtv/libs/libmyth/audiooutpututil.cpp
index 891bf9a..d9af347 100644
--- a/mythtv/libs/libmyth/audiooutpututil.cpp
+++ b/mythtv/libs/libmyth/audiooutpututil.cpp
@@ -451,6 +451,19 @@ static int fromFloatFLT(float *out, float *in, int len)
}
/**
+ * Returns true if platform has an FPU.
+ * for the time being, this test is limited to testing if SSE2 is supported
+ */
+bool AudioOutputUtil::has_hardware_fpu()
+{
+#if ARCH_X86
+ return sse_check();
+#else
+ return false;
+#endif
+}
+
+/**
* Convert integer samples to floats
*
* Consumes 'bytes' bytes from in and returns the numer of bytes written to out
diff --git a/mythtv/libs/libmyth/audiooutpututil.h b/mythtv/libs/libmyth/audiooutpututil.h
index 19dda9f..858fa6e 100644
--- a/mythtv/libs/libmyth/audiooutpututil.h
+++ b/mythtv/libs/libmyth/audiooutpututil.h
@@ -5,9 +5,10 @@ using namespace std;
#include "mythverbose.h"
#include "audiooutputsettings.h"
-class AudioOutputUtil
+class MPUBLIC AudioOutputUtil
{
public:
+ static bool has_hardware_fpu();
static int toFloat(AudioFormat format, void *out, void *in, int bytes);
static int fromFloat(AudioFormat format, void *out, void *in, int bytes);
static void MonoToStereo(void *dst, void *src, int samples);
diff --git a/mythtv/libs/libmythtv/avformatdecoder.cpp b/mythtv/libs/libmythtv/avformatdecoder.cpp
index 9b5e8c9..315a47c 100644
--- a/mythtv/libs/libmythtv/avformatdecoder.cpp
+++ b/mythtv/libs/libmythtv/avformatdecoder.cpp
@@ -15,6 +15,7 @@ using namespace std;
#include "avformatdecoder.h"
#include "privatedecoder.h"
#include "audiooutput.h"
+#include "audiooutpututil.h"
#include "RingBuffer.h"
#include "mythplayer.h"
#include "remoteencoder.h"
@@ -4584,6 +4585,10 @@ void AvFormatDecoder::SetDisablePassThrough(bool disable)
inline bool AvFormatDecoder::DecoderWillDownmix(const AVCodecContext *ctx)
{
+ // Until ffmpeg properly implements dialnorm
+ // use Myth internal downmixer if machines has FPU/SSE
+ if (AudioOutputUtil::has_hardware_fpu())
+ return false;
switch (ctx->codec_id)
{
case CODEC_ID_AC3: