Skip to content

Commit

Permalink
Backport [27370],[27375],[27377]. Fixes #6569 temporarily
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.mythtv.org/svn/branches/release-0-24-fixes@27395 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
jyavenard committed Dec 1, 2010
1 parent 8e616b4 commit 4d4abe5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
13 changes: 13 additions & 0 deletions mythtv/libs/libmyth/audiooutpututil.cpp
Expand Up @@ -450,6 +450,19 @@ static int fromFloatFLT(float *out, float *in, int len)
return len << 2;
}

/**
* 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
*
Expand Down
3 changes: 2 additions & 1 deletion mythtv/libs/libmyth/audiooutpututil.h
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions mythtv/libs/libmythtv/avformatdecoder.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 4d4abe5

Please sign in to comment.