summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Yves Avenard <jyavenard@mythtv.org>2010-11-23 13:01:41 (GMT)
committer Jean-Yves Avenard <jyavenard@mythtv.org>2010-11-23 13:01:41 (GMT)
commitd8ba8af285ac35486a3e28dd73c16603858de24d (patch)
treec6990069245da4268398945ddf09d7684023deb8
parenta9d80d88cc3f7c369e67ff5417f176f63b34adca (diff)
Final fix for #9257, AC3 content wasn't being upmixed. Bump library API version, make clean all on plugins will be required
git-svn-id: http://svn.mythtv.org/svn/trunk@27323 7dbf422c-18fa-0310-86e9-fd20926502f2
-rw-r--r--mythtv/libs/libmyth/audiooutput.h2
-rw-r--r--mythtv/libs/libmyth/audiooutputbase.cpp9
-rw-r--r--mythtv/libs/libmyth/audiooutputbase.h2
-rw-r--r--mythtv/libs/libmyth/audiooutputsettings.cpp5
-rw-r--r--mythtv/libs/libmythdb/mythversion.h2
-rw-r--r--mythtv/libs/libmythtv/audioplayer.cpp4
-rw-r--r--mythtv/libs/libmythtv/audioplayer.h2
-rw-r--r--mythtv/libs/libmythtv/avformatdecoder.cpp7
-rw-r--r--mythtv/programs/mythtranscode/transcode.cpp2
9 files changed, 16 insertions, 19 deletions
diff --git a/mythtv/libs/libmyth/audiooutput.h b/mythtv/libs/libmyth/audiooutput.h
index bd1b581..9367688 100644
--- a/mythtv/libs/libmyth/audiooutput.h
+++ b/mythtv/libs/libmyth/audiooutput.h
@@ -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;
diff --git a/mythtv/libs/libmyth/audiooutputbase.cpp b/mythtv/libs/libmyth/audiooutputbase.cpp
index cff9396..e79976f 100644
--- a/mythtv/libs/libmyth/audiooutputbase.cpp
+++ b/mythtv/libs/libmyth/audiooutputbase.cpp
@@ -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;
}
diff --git a/mythtv/libs/libmyth/audiooutputbase.h b/mythtv/libs/libmyth/audiooutputbase.h
index 9d943ad..f46928d 100644
--- a/mythtv/libs/libmyth/audiooutputbase.h
+++ b/mythtv/libs/libmyth/audiooutputbase.h
@@ -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);
diff --git a/mythtv/libs/libmyth/audiooutputsettings.cpp b/mythtv/libs/libmyth/audiooutputsettings.cpp
index bab08a9..128b93f 100644
--- a/mythtv/libs/libmyth/audiooutputsettings.cpp
+++ b/mythtv/libs/libmyth/audiooutputsettings.cpp
@@ -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;
diff --git a/mythtv/libs/libmythdb/mythversion.h b/mythtv/libs/libmythdb/mythversion.h
index 4dcb60d..adc58b7 100644
--- a/mythtv/libs/libmythdb/mythversion.h
+++ b/mythtv/libs/libmythdb/mythversion.h
@@ -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.
*
diff --git a/mythtv/libs/libmythtv/audioplayer.cpp b/mythtv/libs/libmythtv/audioplayer.cpp
index dddf512..f922676 100644
--- a/mythtv/libs/libmythtv/audioplayer.cpp
+++ b/mythtv/libs/libmythtv/audioplayer.cpp
@@ -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;
}
diff --git a/mythtv/libs/libmythtv/audioplayer.h b/mythtv/libs/libmythtv/audioplayer.h
index 8a50c84..68a7284 100644
--- a/mythtv/libs/libmythtv/audioplayer.h
+++ b/mythtv/libs/libmythtv/audioplayer.h
@@ -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);
diff --git a/mythtv/libs/libmythtv/avformatdecoder.cpp b/mythtv/libs/libmythtv/avformatdecoder.cpp
index be1e61c..51b2424 100644
--- a/mythtv/libs/libmythtv/avformatdecoder.cpp
+++ b/mythtv/libs/libmythtv/avformatdecoder.cpp
@@ -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;
}
diff --git a/mythtv/programs/mythtranscode/transcode.cpp b/mythtv/programs/mythtranscode/transcode.cpp
index 35f54e6..121495c 100644
--- a/mythtv/programs/mythtranscode/transcode.cpp
+++ b/mythtv/programs/mythtranscode/transcode.cpp
@@ -115,7 +115,7 @@ class AudioReencodeBuffer : public AudioOutput
{
last_audiotime = timecode;
}
- virtual bool CanPassthrough(int) const
+ virtual bool CanPassthrough(int, int) const
{
return false;
}