Skip to content

Commit

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

Expand Down

0 comments on commit a635a7b

Please sign in to comment.