Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
revert [27370]. Myth downmixer is now used at all time if machines ha…
…s SSE2 support. This change will be removed once ffmpeg properly implements dialnorm

git-svn-id: http://svn.mythtv.org/svn/trunk@27375 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
jyavenard committed Nov 30, 2010
1 parent f31f224 commit c0fc092
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
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
1 change: 1 addition & 0 deletions mythtv/libs/libmyth/audiooutpututil.h
Expand Up @@ -8,6 +8,7 @@ using namespace std;
class 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
7 changes: 4 additions & 3 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 @@ -4501,10 +4502,10 @@ void AvFormatDecoder::SetDisablePassThrough(bool disable)

inline bool AvFormatDecoder::DecoderWillDownmix(const AVCodecContext *ctx)
{
if (gCoreContext->GetNumSetting("AdvancedAudioSettings", false) &&
gCoreContext->GetNumSetting("AudioDownmixOverride", false))
// 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
14 changes: 0 additions & 14 deletions mythtv/programs/mythfrontend/globalsettings.cpp
Expand Up @@ -195,7 +195,6 @@ AudioConfigSettings::AudioConfigSettings() :
ConfigurationGroup *settings5 =
new HorizontalConfigurationGroup(false, false);
settings5->addChild(Audio48kOverride());
settings5->addChild(DownmixOverride());

m_triggerMPCM = new TransCheckBoxSetting();
m_MPCM = MPCM();
Expand Down Expand Up @@ -476,19 +475,6 @@ HostCheckBox *AudioConfigSettings::Audio48kOverride()
return gc;
}

HostCheckBox *AudioConfigSettings::DownmixOverride()
{
HostCheckBox *gc = new HostCheckBox("AudioDownmixOverride");
gc->setLabel(QObject::tr("Always use internal downmixer"));
gc->setValue(false);
gc->setHelpText(QObject::tr("If uncheck, for AC3 and DTS audio content; "
"use ffmpeg's internal downmixer when required."
" If checked, Myth's own downmixer will be used"
" for all content. While not as fast, it "
"doesn't suffer from low volume issues."));
return gc;
}

HostCheckBox *AudioConfigSettings::PassThroughOverride()
{
HostCheckBox *gc = new HostCheckBox("PassThruDeviceOverride");
Expand Down
1 change: 0 additions & 1 deletion mythtv/programs/mythfrontend/globalsettings.h
Expand Up @@ -43,7 +43,6 @@ class AudioConfigSettings : public VerticalConfigurationGroup
HostCheckBox *SRCQualityOverride();
HostComboBox *SRCQuality();
HostCheckBox *Audio48kOverride();
HostCheckBox *DownmixOverride();
HostCheckBox *PassThroughOverride();
HostComboBox *PassThroughOutputDevice();

Expand Down

0 comments on commit c0fc092

Please sign in to comment.