Permalink
Browse files

Backport SHA: a635a7b from master to fixes/0.24

Fix a segmentation fault in preview generation.
  • Loading branch information...
1 parent 5aa7665 commit 7ed83c31d266b971c97c5f12bf4801a8135893bf Doug Haber committed with Mark Kendall Dec 17, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 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))

0 comments on commit 7ed83c3

Please sign in to comment.