summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Haber <>2010-12-17 00:19:03 (GMT)
committer Mark Kendall <mkendall@mythtv.org>2010-12-17 00:19:03 (GMT)
commita635a7b288d8e14569707513995a5af06bb637e6 (patch)
treee49bee5aafbc7210b4e99524b86ecc2aa7a41ea6
parent4bc8f6f494f019f7867c93b8644cc1fe0b7cf8e9 (diff)
Fix a segmentation fault in preview generation.
-rw-r--r--mythtv/libs/libmythtv/audioplayer.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/mythtv/libs/libmythtv/audioplayer.cpp b/mythtv/libs/libmythtv/audioplayer.cpp
index 27f6f79..4043dd3 100644
--- a/mythtv/libs/libmythtv/audioplayer.cpp
+++ b/mythtv/libs/libmythtv/audioplayer.cpp
@@ -345,12 +345,14 @@ bool AudioPlayer::CanPassthrough(int samplerate, int channels)
void AudioPlayer::AddAudioData(char *buffer, int len, int64_t timecode)
{
- if (m_parent->PrepareAudioSample(timecode) && m_audioOutput &&
- !no_audio_out)
+ if (!m_audioOutput)
+ return;
+
+ if (m_parent->PrepareAudioSample(timecode) && !no_audio_out)
m_audioOutput->Drain();
int samplesize = m_audioOutput->GetBytesPerFrame();
- if ((samplesize <= 0) || !m_audioOutput)
+ if (samplesize <= 0)
return;
int frames = len / samplesize;