## xine-devel

 [xine-devel] pts_per_smpls From: - 2004-05-26 02:35:20 Attachments: Message as HTML ```hi all, I am going through the code ox xine lib and trying to understand different aspects of playback. In that there is a parameter called pts_per_smpls which is calculated using the logic given below. (int64_t)90000 * (int64_t)32768 / (int64_t) this->input.rate In this i understand that this->input.rate is the sampling frequency. What are the factors 90000 and 32768 means and from where have they drawn from? Any tips would greatly help my understanding. Thanks -onup Yahoo! India Matrimony: Find your partner online.```
 Re: [xine-devel] pts_per_smpls From: James Courtier-Dutton - 2004-05-26 10:47:02 ```chikku belli wrote: > hi all, > > I am going through the code ox xine lib and trying to understand different aspects of playback. In that there is a parameter called pts_per_smpls which is calculated using the logic given below. > > (int64_t)90000 * (int64_t)32768 / (int64_t) this->input.rate > > In this i understand that this->input.rate is the sampling frequency. What are the factors 90000 and 32768 means and from where have they drawn from? > > Any tips would greatly help my understanding. > > Thanks > -onup > The units of PTS are 90000 per second. We use fixed point floating point arithmatic using int64_t ints in pts_per_sample. E.g. A floating point number of 1.0 => 1.0 * 32768 -> int64_t of 32768 Converting back int64_t of 32768 -> 32768 / 32768 -> float of 1.0 float of 0.5 -> 0.5 * 32768 -> int64_t 16384 etc. Cheers James ```