Skip to content

Commit

Permalink
Backport SHA: a635a7b from master to fixes/0.24
Browse files Browse the repository at this point in the history
Fix a segmentation fault in preview generation.
  • Loading branch information
Doug Haber authored and Mark Kendall committed Dec 17, 2010
1 parent 5aa7665 commit 7ed83c3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mythtv/libs/libmythtv/audioplayer.cpp
Expand Up @@ -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))
Expand Down

0 comments on commit 7ed83c3

Please sign in to comment.