Skip to content
Snippets Groups Projects
  • Jim's avatar
    9f1a3c31
    Add preliminary handling of timestamp invalidation · 9f1a3c31
    Jim authored
    - Add preliminary (yet to be tested) handling of timestamp invalidation
      issues that can happen with specific devices, where timestamps can
      reset or go backward/forward in time with no rhyme or reason.  Spent
      the entire day just trying to figure out the best way to handle this.
    
      If both audio and video are present, it will increment a reference
      counter if video timestamps invalidate, and decrement the reference
      counter when the audio timestamps invalidate.  When the reference
      counter is not 0, it will not send audio as the audio will have
      invalid timing.  What this does is it ensures audio data will never go
      out of bounds in relation to the video, and waits for both audio and
      video timestamps to "jump" together before resuming audio.
    
    - Moved async video frame timing adjustment code into
      obs_source_getframe instead so it's automatically handled whenever
      called.
    
    - Removed the 'audio wait buffer' as it was an unnecessary complexity
      that could have had problems in the future.  Instead, audio will not
      be added until video starts for sources that have both async
      audio/video.  Audio could have buffered for too long of a time anyway,
      who knows what devices are going to do.
    
    - Fixed a minor conversion warning in audio-io.c
    9f1a3c31
    History
    Add preliminary handling of timestamp invalidation
    Jim authored
    - Add preliminary (yet to be tested) handling of timestamp invalidation
      issues that can happen with specific devices, where timestamps can
      reset or go backward/forward in time with no rhyme or reason.  Spent
      the entire day just trying to figure out the best way to handle this.
    
      If both audio and video are present, it will increment a reference
      counter if video timestamps invalidate, and decrement the reference
      counter when the audio timestamps invalidate.  When the reference
      counter is not 0, it will not send audio as the audio will have
      invalid timing.  What this does is it ensures audio data will never go
      out of bounds in relation to the video, and waits for both audio and
      video timestamps to "jump" together before resuming audio.
    
    - Moved async video frame timing adjustment code into
      obs_source_getframe instead so it's automatically handled whenever
      called.
    
    - Removed the 'audio wait buffer' as it was an unnecessary complexity
      that could have had problems in the future.  Instead, audio will not
      be added until video starts for sources that have both async
      audio/video.  Audio could have buffered for too long of a time anyway,
      who knows what devices are going to do.
    
    - Fixed a minor conversion warning in audio-io.c