Skip to content

Commit

Permalink
squash: Use bit mask for resampler flags
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Mar 7, 2015
1 parent fbd48e3 commit a275f7f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions xbmc/cores/AudioEngine/AEResampleFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
namespace ActiveAE
{

IAEResample *CAEResampleFactory::Create(bool force_ffmpeg /* = false */)
IAEResample *CAEResampleFactory::Create(uint32_t flags /* = 0 */)
{
#if defined(TARGET_RASPBERRY_PI)
if (!force_ffmpeg && CSettings::Get().GetInt("audiooutput.processquality") == AE_QUALITY_GPU)
if (!(flags & AERESAMPLEFACTORY_QUICK_RESAMPLE) && CSettings::Get().GetInt("audiooutput.processquality") == AE_QUALITY_GPU)
return new CActiveAEResamplePi();
#endif
return new CActiveAEResampleFFMPEG();
Expand Down
9 changes: 8 additions & 1 deletion xbmc/cores/AudioEngine/AEResampleFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@ class IAEResample;
namespace ActiveAE
{

/**
* Bit options to pass to IAE::GetStream
*/
enum AEStreamOptions {
AERESAMPLEFACTORY_QUICK_RESAMPLE = 0x01 /* This is a quick resample job (e.g. resample a single noise packet) and may not be worth using GPU acceleration */
};

class CAEResampleFactory
{
public:
static IAEResample *Create(bool force_ffmpeg = false);
static IAEResample *Create(uint32_t flags = 0);
};

}
2 changes: 1 addition & 1 deletion xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ void CActiveAESink::GenerateNoise()
}

SampleConfig config = m_sampleOfSilence.pkt->config;
IAEResample *resampler = CAEResampleFactory::Create(true);
IAEResample *resampler = CAEResampleFactory::Create(AERESAMPLEFACTORY_QUICK_RESAMPLE);
resampler->Init(config.channel_layout,
config.channels,
config.sample_rate,
Expand Down

0 comments on commit a275f7f

Please sign in to comment.