Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
AOBASE: SRC was setup with 'source_channels' but if we downmix we onl…
…y get 'channels'

Signed-off-by: Jean-Yves Avenard <jyavenard@mythtv.org>
  • Loading branch information
nlp80 authored and jyavenard committed Jan 29, 2011
1 parent c884505 commit 06c8142
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions mythtv/libs/libmyth/audiooutputbase.cpp
Expand Up @@ -466,7 +466,9 @@ void AudioOutputBase::Reconfigure(const AudioSettings &orig_settings)
.arg(settings.samplerate/1000).arg(samplerate/1000)
.arg(quality_string(src_quality)));

src_ctx = src_new(2-src_quality, source_channels, &error);
int chans = needs_downmix ? channels : source_channels;

src_ctx = src_new(2-src_quality, chans, &error);
if (error)
{
Error(QString("Error creating resampler: %1")
Expand All @@ -475,11 +477,11 @@ void AudioOutputBase::Reconfigure(const AudioSettings &orig_settings)
return;
}

src_data.src_ratio = (double)samplerate / settings.samplerate;
src_data.data_in = src_in;
int newsize = ((long)((float)kAudioSRCInputSize *
samplerate / settings.samplerate) +
15) & ~0xf;
src_data.src_ratio = (double)samplerate / settings.samplerate;
src_data.data_in = src_in;
int newsize = (int)(kAudioSRCInputSize * src_data.src_ratio + 15)
& ~0xf;

if (kAudioSRCOutputSize < newsize)
{
kAudioSRCOutputSize = newsize;
Expand Down

0 comments on commit 06c8142

Please sign in to comment.