title: ffmpeg's av_read_frame will block or not?
body: <p>There is a question posted on StackOverflow that asks if there is any mode to wait until a valid data comes with <a href="https://www.ffmpeg.org/doxygen/2.8/group__lavf__decoding.html#ga4fdb3084415a82e3810de6ee60e46a61" rel="nofollow noreferrer">av_read_frame</a>: <a href="https://stackoverflow.com/questions/27577642/setting-a-timeout-for-av-read-frame">link</a>.</p>
  
  <p>My question is the opposite:
  Can I be sure that this method will always return with either -1, 0 or 1?</p>
  
  <p>I.e. it will <strong>not</strong> block? In the official docs, there is no mention on this subject.</p>
  
  <p>Some threads also mention setting up an interrupt callback for this purpose.</p>
  
  <p>But I would need a solid non-blocking call which means I can do other tasks during waiting for a network video. If there is no exact way to define if av_read_frame can be set to non-blocking I would go with threads but I'd rather not doing that.</p>