Ticket #9382: aplayer.patch

File aplayer.patch, 968 bytes (added by doug@…, 10 years ago)

patch for above seg fault

  • mythtv/libs/libmythtv/audioplayer.cpp

    diff --git a/mythtv/libs/libmythtv/audioplayer.cpp b/mythtv/libs/libmythtv/audioplayer.cpp
    index 27f6f79..de1aae7 100644
    a b bool AudioPlayer::CanPassthrough(int samplerate, int channels) 
    345345
    346346void AudioPlayer::AddAudioData(char *buffer, int len, int64_t timecode)
    347347{
    348     if (m_parent->PrepareAudioSample(timecode) && m_audioOutput &&
    349         !no_audio_out)
     348    if (!m_audioOutput)
     349        return;
     350
     351    if (m_parent->PrepareAudioSample(timecode) && !no_audio_out)
    350352        m_audioOutput->Drain();
     353
    351354    int samplesize = m_audioOutput->GetBytesPerFrame();
    352355
    353     if ((samplesize <= 0) || !m_audioOutput)
     356    if (samplesize <= 0)
    354357        return;
    355358    int frames = len / samplesize;
    356359
     360
    357361    if (!m_audioOutput->AddFrames(buffer, frames, timecode))
    358362        VERBOSE(VB_PLAYBACK, LOC + "AddAudioData(): "
    359363                "Audio buffer overflow, audio data lost!");