title: detecting a timeout in ffmpeg
body: <p>I am writing some software that uses ffmpeg extensively and it is multi threaded, with multiple class instances.</p>
  
  <p>If the network connection drops out ffmpeg hangs on reading. I found a method to assign a callback that ffmpeg fires periodically to check if it should abort or not:</p>
  
  <pre><code>static int interrupt_cb(void *ctx) 
  { 
  
  // do something 
      return 0;
  } 
  
  static const libffmpeg::AVIOInterruptCB int_cb = { interrupt_cb, NULL }; 
  </code></pre>
  
  <p>...</p>
  
  <pre><code>AVFormatContext* formatContext = libffmpeg::avformat_alloc_context( );
  formatContext-&gt;interrupt_callback = int_cb; 
  if ( libffmpeg::avformat_open_input( &amp;formatContext, fileName, NULL, NULL ) !=0 ) {...}
  </code></pre>
  
  <p>This is all fine but nowhere on the web can i find what *ctx contains and how to determine whether the callback should return 1 or 0. I can't assign a static "abort" flag as the class has many instances. I also can't debug the code as for some reason visual studio refuses to set a breakpoint on the return 0; line, claiming no executable code is associated with the location. Any ideas?</p>