HLS

  1. While presenting normal-rate content, a software demuxer is used to extract PTS from Audio and Video elementary streams.  This can be disabled at runtime using aamp.cfg.
  2. PCR is smaller than PTS.  PCR is used as a BasePTS normally, but if difference between PCR and first PTS exceeds 500ms, we instead use PTS-500ms as BasePTS.  Software Demuxer subtracts BasePTS and uses this as timestamp for elementary streams.
  1. While presenting iframes for TrickPlay, AAMP’s software demuxer does not modify timestamps.  Instead they are is calculated in the fragment collector taking into account desired play rate (trick speed) and frames per seconds (smoothness).  Re-timestamping is done, but it not done in software demux. Here presentation timestamps from TS are not used, but fragment start time from the manifest and rate are used to calculate a final PTS. Updated position is calculated by: updatedPosition = m_startPosition + (position - m_startPosition) / m_playRate; where m_startPosition is position of first es injected.
  2. Primary reason for using s/w demuxer (leveraging code used with QAM RMF player) is to eliminate channel change delay manifesting as a freeze in playersinkbin.  Production content .ts fragments contain video concatenated (not interleaved) with audio.  With BCOM demuxer, we see video freeze before it starts moving.  With SW demuxer, full motion video presents immediately. Other advantages are: