summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Haber <>2010-12-17 00:32:37 (GMT)
committer Mark Kendall <mkendall@mythtv.org>2010-12-17 00:32:37 (GMT)
commit7ed83c31d266b971c97c5f12bf4801a8135893bf (patch)
tree29c1ee2a1b9f2e919a0cff3fecae445c0f69ef66
parent5aa7665c6b0a3d7018d5ad530e347686fb21aaae (diff)
Backport SHA: a635a7b288d8e1456970 from master to fixes/0.24
Fix a segmentation fault in preview generation.
-rw-r--r--mythtv/libs/libmythtv/audioplayer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/mythtv/libs/libmythtv/audioplayer.cpp b/mythtv/libs/libmythtv/audioplayer.cpp
index b4a1ca6..1593df7 100644
--- a/mythtv/libs/libmythtv/audioplayer.cpp
+++ b/mythtv/libs/libmythtv/audioplayer.cpp
@@ -331,11 +331,12 @@ 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_channels * AudioOutputSettings::SampleSize(m_format);
- if ((samplesize <= 0) || !m_audioOutput)
+ if (samplesize <= 0)
return;
int frames = len / samplesize;
if (!m_audioOutput->AddFrames(buffer, frames, timecode))