Skip to content

Commit

Permalink
Final fix for #9257, AC3 content wasn't being upmixed. Bump library A…
Browse files Browse the repository at this point in the history
…PI version, make clean all on plugins will be required

git-svn-id: http://svn.mythtv.org/svn/trunk@27323 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
jyavenard committed Nov 23, 2010
1 parent a9d80d8 commit d8ba8af
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/audiooutput.h
Expand Up @@ -65,7 +65,7 @@ class MPUBLIC AudioOutput : public VolumeBase, public OutputListeners
{ return new AudioOutputSettings; }
virtual AudioOutputSettings* GetOutputSettingsUsers(void)
{ return new AudioOutputSettings; }
virtual bool CanPassthrough(int samplerate) const = 0;
virtual bool CanPassthrough(int samplerate, int channels) const = 0;

// dsprate is in 100 * samples/second
virtual void SetEffDsp(int dsprate) = 0;
Expand Down
9 changes: 8 additions & 1 deletion mythtv/libs/libmyth/audiooutputbase.cpp
Expand Up @@ -200,11 +200,18 @@ AudioOutputSettings* AudioOutputBase::GetOutputSettingsUsers(void)
/**
* Test if we can output digital audio and if sample rate is supported
*/
bool AudioOutputBase::CanPassthrough(int samplerate) const
bool AudioOutputBase::CanPassthrough(int samplerate, int channels) const
{
bool ret = false;
ret = output_settings->IsSupportedFormat(FORMAT_S16);
ret &= output_settings->IsSupportedRate(samplerate);
// Don't know any cards that support spdif clocked at < 44100
// Some US cable transmissions have 2ch 32k AC-3 streams
ret &= samplerate >= 44100;
// Will downmix if we can't support the amount of channels
ret &= channels <= max_channels;
// Stereo content will always be decoded so it can later be upmixed
ret &= channels != 2;

return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/audiooutputbase.h
Expand Up @@ -62,7 +62,7 @@ class AudioOutputBase : public AudioOutput, public QThread
virtual void SetStretchFactor(float factor);
virtual float GetStretchFactor(void) const;

virtual bool CanPassthrough(int samplerate) const;
virtual bool CanPassthrough(int samplerate, int channels) const;
virtual bool ToggleUpmix(void);

virtual void Reset(void);
Expand Down
5 changes: 0 additions & 5 deletions mythtv/libs/libmyth/audiooutputsettings.cpp
Expand Up @@ -319,11 +319,6 @@ AudioOutputSettings* AudioOutputSettings::GetUsers(bool newcopy)
cur_channels = max_channels;

aosettings->SetBestSupportedChannels(cur_channels);
// do not passthrough stereo AC3 or stereo DTS
// this is required should we need to upmix and at this stage of the
// audio lifecycle, we don't know if we will upconvert or not
if (cur_channels <= 2)
bDTS = bAC3 = false;
aosettings->m_AC3 = bAC3;
aosettings->m_DTS = bDTS;
aosettings->m_LPCM = bLPCM;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythdb/mythversion.h
Expand Up @@ -11,7 +11,7 @@
/// Update this whenever the plug-in API changes.
/// Including changes in the libmythdb, libmyth, libmythtv, libmythav* and
/// libmythui class methods used by plug-ins.
#define MYTH_BINARY_VERSION "0.25.20101120-1"
#define MYTH_BINARY_VERSION "0.25.20101123-1"

/** \brief Increment this whenever the MythTV network protocol changes.
*
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/audioplayer.cpp
Expand Up @@ -321,11 +321,11 @@ uint AudioPlayer::GetMaxChannels(void)
return ret;
}

bool AudioPlayer::CanPassthrough(int samplerate)
bool AudioPlayer::CanPassthrough(int samplerate, int channels)
{
bool ret = false;
if (m_audioOutput)
ret = m_audioOutput->CanPassthrough(samplerate);
ret = m_audioOutput->CanPassthrough(samplerate, channels);
return ret;
}

Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/audioplayer.h
Expand Up @@ -39,7 +39,7 @@ class MPUBLIC AudioPlayer
float GetStretchFactor(void) { return m_stretchfactor; }
void SetStretchFactor(float factor);
bool ToggleUpmix(void);
bool CanPassthrough(int samplerate);
bool CanPassthrough(int samplerate, int channels);
bool CanAC3(void);
bool CanDTS(void);
uint GetMaxChannels(void);
Expand Down
7 changes: 1 addition & 6 deletions mythtv/libs/libmythtv/avformatdecoder.cpp
Expand Up @@ -4603,14 +4603,9 @@ bool AvFormatDecoder::DoPassThrough(const AVCodecContext *ctx)
passthru = m_audio->CanAC3();
else if (ctx->codec_id == CODEC_ID_DTS)
passthru = m_audio->CanDTS();
passthru &= m_audio->CanPassthrough(ctx->sample_rate);
// Will downmix if we can't support the amount of channels
passthru &= ctx->channels <= (int)m_audio->GetMaxChannels();
passthru &= m_audio->CanPassthrough(ctx->sample_rate, ctx->channels);
passthru &= !internal_vol;
passthru &= !transcoding && !disable_passthru;
// Don't know any cards that support spdif clocked at < 44100
// Some US cable transmissions have 2ch 32k AC-3 streams
passthru &= ctx->sample_rate >= 44100;

return passthru;
}
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythtranscode/transcode.cpp
Expand Up @@ -115,7 +115,7 @@ class AudioReencodeBuffer : public AudioOutput
{
last_audiotime = timecode;
}
virtual bool CanPassthrough(int) const
virtual bool CanPassthrough(int, int) const
{
return false;
}
Expand Down

0 comments on commit d8ba8af

Please sign in to comment.