Re: Error causes floating point exception in CAudioOutLinuxAlsa::_SetDeviceConfig()

Greg Wright <[email protected]>
Newsgroups gmane.comp.multimedia.helix.devel
Message-ID <[email protected]>
Nguyen, Khanh V wrote:
> Hi,
> 
> In the CAudioOutLinuxAlsa::_SetDeviceConfig() method, if there’s an 
> error before the snd_pcm_hw_params_get_period_size(hwparams, 
> &period_size, 0) call, it will skip this call.  When this call is 
> skipped, period_size is zero.  When the calculation for start_threshold 
> started, a floating point exception is thrown because of a 
> divide-by-zero problem. 
> 
>  
> 
> Could someone apply a quick patch for this?  I currently don’t have 
> commit access.

I can help, but can you apply the patch since you can test it?

I am not sure, but it seems perhaps that we just need to make
the period_size, and m_PeriodSize, default to 1 perhaps if that
define isn't there.

Come up with what works for you, send in a CR like normal and I
will review it and then commit it for you as needed.

--greg.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.