summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Yves Avenard <jyavenard@mythtv.org>2010-11-18 05:34:04 (GMT)
committer Jean-Yves Avenard <jyavenard@mythtv.org>2010-11-18 05:34:04 (GMT)
commitc8e66a476de6766ab1e4b980d8ed37e52065d517 (patch)
tree918692061e89e4a8062867681ef24cd81816f0a1
parent6427d5ae20660b06f98eb27649ca86b6958ca672 (diff)
Backport [27273]. Remove display of parameters errors when the audio object is first created ; this should reduce invalid bug reports
git-svn-id: http://svn.mythtv.org/svn/branches/release-0-24-fixes@27277 7dbf422c-18fa-0310-86e9-fd20926502f2
-rw-r--r--mythtv/libs/libmyth/audiooutput.cpp6
-rw-r--r--mythtv/libs/libmyth/audiooutput.h1
-rw-r--r--mythtv/libs/libmyth/audiooutputbase.cpp16
-rw-r--r--mythtv/libs/libmythtv/audioplayer.cpp29
-rw-r--r--mythtv/libs/libmythtv/playercontext.cpp2
5 files changed, 34 insertions, 20 deletions
diff --git a/mythtv/libs/libmyth/audiooutput.cpp b/mythtv/libs/libmyth/audiooutput.cpp
index 30f3632..117d74c 100644
--- a/mythtv/libs/libmyth/audiooutput.cpp
+++ b/mythtv/libs/libmyth/audiooutput.cpp
@@ -192,6 +192,12 @@ void AudioOutput::Error(const QString &msg)
VERBOSE(VB_IMPORTANT, "AudioOutput Error: " + lastError);
}
+void AudioOutput::SilentError(const QString &msg)
+{
+ lastError = msg;
+ lastError.detach();
+}
+
void AudioOutput::Warn(const QString &msg)
{
lastWarn = msg;
diff --git a/mythtv/libs/libmyth/audiooutput.h b/mythtv/libs/libmyth/audiooutput.h
index 403dc8f..bd1b581 100644
--- a/mythtv/libs/libmyth/audiooutput.h
+++ b/mythtv/libs/libmyth/audiooutput.h
@@ -105,6 +105,7 @@ class MPUBLIC AudioOutput : public VolumeBase, public OutputListeners
protected:
void Error(const QString &msg);
+ void SilentError(const QString &msg);
void Warn(const QString &msg);
void ClearError(void);
void ClearWarning(void);
diff --git a/mythtv/libs/libmyth/audiooutputbase.cpp b/mythtv/libs/libmyth/audiooutputbase.cpp
index d0dcb55..cff9396 100644
--- a/mythtv/libs/libmyth/audiooutputbase.cpp
+++ b/mythtv/libs/libmyth/audiooutputbase.cpp
@@ -396,21 +396,21 @@ void AudioOutputBase::Reconfigure(const AudioSettings &orig_settings)
was_paused = true;
internal_vol = gCoreContext->GetNumSetting("MythControlsVolume", 0);
- VBAUDIO(QString("Original codec was %1, %2, %3 kHz, %4 channels")
- .arg(ff_codec_id_string((CodecID)codec))
- .arg(output_settings->FormatToString(format))
- .arg(samplerate/1000).arg(source_channels));
-
// Don't try to do anything if audio hasn't been
// initialized yet (e.g. rubbish was provided)
if (source_channels <= 0 || format <= 0 || samplerate <= 0)
{
- Error(QString("Aborting Audio Reconfigure. ") +
- QString("Invalid audio parameters ch %1 fmt %2 @ %3Hz")
- .arg(source_channels).arg(format).arg(samplerate));
+ SilentError(QString("Aborting Audio Reconfigure. ") +
+ QString("Invalid audio parameters ch %1 fmt %2 @ %3Hz")
+ .arg(source_channels).arg(format).arg(samplerate));
return;
}
+ VBAUDIO(QString("Original codec was %1, %2, %3 kHz, %4 channels")
+ .arg(ff_codec_id_string((CodecID)codec))
+ .arg(output_settings->FormatToString(format))
+ .arg(samplerate/1000).arg(source_channels));
+
/* Encode to AC-3 if we're allowed to passthru but aren't currently
and we have more than 2 channels but multichannel PCM is not supported
or if the device just doesn't support the number of channels */
diff --git a/mythtv/libs/libmythtv/audioplayer.cpp b/mythtv/libs/libmythtv/audioplayer.cpp
index db01e37..dddf512 100644
--- a/mythtv/libs/libmythtv/audioplayer.cpp
+++ b/mythtv/libs/libmythtv/audioplayer.cpp
@@ -5,8 +5,8 @@
#define LOC QString("AudioPlayer: ")
AudioPlayer::AudioPlayer(MythPlayer *parent, bool muted)
- : m_parent(parent), m_audioOutput(NULL), m_channels(2),
- m_orig_channels(2), m_codec(0), m_format(FORMAT_NONE),
+ : m_parent(parent), m_audioOutput(NULL), m_channels(-1),
+ m_orig_channels(-1), m_codec(0), m_format(FORMAT_NONE),
m_samplerate(44100), m_stretchfactor(1.0f), m_passthru(false),
m_lock(QMutex::Recursive), m_muted_on_creation(muted),
m_main_device(QString::null), m_passthru_device(QString::null),
@@ -44,18 +44,24 @@ QString AudioPlayer::ReinitAudio(void)
QMutexLocker lock(&m_lock);
QString errMsg = QString::null;
+ bool firstinit = (m_format == FORMAT_NONE &&
+ m_channels < 0 &&
+ m_samplerate == 44100);
+
if ((m_format == FORMAT_NONE) ||
(m_channels <= 0) ||
(m_samplerate <= 0))
{
- VERBOSE(VB_IMPORTANT, LOC +
- QString("Disabling Audio, params(%1,%2,%3)")
- .arg(m_format).arg(m_channels).arg(m_samplerate));
-
+ if (!firstinit)
+ {
+ VERBOSE(VB_IMPORTANT, LOC +
+ QString("Disabling Audio, params(%1,%2,%3)")
+ .arg(m_format).arg(m_channels).arg(m_samplerate));
+ }
no_audio_in = no_audio_out = true;
}
-
- no_audio_in = false;
+ else
+ no_audio_in = false;
if (no_audio_out && want_audio)
{
@@ -76,8 +82,11 @@ QString AudioPlayer::ReinitAudio(void)
if (!errMsg.isEmpty())
{
- VERBOSE(VB_IMPORTANT, LOC + "Disabling Audio" +
- QString(", reason is: %1").arg(errMsg));
+ if (!firstinit)
+ {
+ VERBOSE(VB_IMPORTANT, LOC + "Disabling Audio" +
+ QString(", reason is: %1").arg(errMsg));
+ }
no_audio_out = true;
}
else if (no_audio_out)
diff --git a/mythtv/libs/libmythtv/playercontext.cpp b/mythtv/libs/libmythtv/playercontext.cpp
index 9b43b54..2464bdd 100644
--- a/mythtv/libs/libmythtv/playercontext.cpp
+++ b/mythtv/libs/libmythtv/playercontext.cpp
@@ -468,8 +468,6 @@ bool PlayerContext::CreatePlayer(TV *tv, QWidget *widget,
if (audio->HasAudioOut())
{
QString errMsg = audio->ReinitAudio();
- if (!errMsg.isEmpty())
- VERBOSE(VB_IMPORTANT, LOC_ERR + errMsg);
}
}
else if (pipState == kPBPRight)