Ticket #1598: alsa-params.patch

File alsa-params.patch, 1.3 KB (added by Martin Ebourne <martin@…>, 20 years ago)

Patch against r9546

  • mythtv/libs/libmyth/audiooutputalsa.cpp

     
    4848    QString real_device = audiodevice;
    4949    if (audio_passthru)
    5050        real_device.append(":{ AES0 0x02 }");
    51    
     51
    5252    err = snd_pcm_open(&pcm_handle, real_device,
    53           SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
     53                       SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
    5454
    5555    if (err < 0)
    56     {
    57         Error(QString("snd_pcm_open(%1): %2")
    58               .arg(audiodevice).arg(snd_strerror(err)));
    59         if (pcm_handle)
    60             CloseDevice();
    61         return false;
     56    {
     57        // Maybe the driver didn't like the extra parameters. Try again without
     58        err = snd_pcm_open(&pcm_handle, audiodevice,
     59                           SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
     60
     61        if (err < 0)
     62        {
     63            Error(QString("snd_pcm_open(%1): %2")
     64                  .arg(audiodevice).arg(snd_strerror(err)));
     65            if (pcm_handle)
     66                CloseDevice();
     67            return false;
     68        }
    6269    }
    6370
    6471    /* the audio fragment size was computed by using the next lower power of 2