<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 27.10.2016 13:01, qw wrote:<br>
    <blockquote
      cite="mid:54f8d888.ea54.15805cd39e9.Coremail.applemax82@163.com"
      type="cite">
      <div
        style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial">
        <div>Hi,</div>
        <div><br>
        </div>
        <div>ffmpeg 2.8.6 is used to develop application, which reads
          rtmp stream and does some video processing. 'AVIOInterruptCB
          interrupt_callback' is used to avoid indefinite waiting if
          there is no avpackets in network. But it doesn't work, and
          avformat_open_input() waits forever. My source code is shown
          as follows:</div>
        <div><br>
        </div>
        <div>
          <div>static int decodeInterruptCb(void *p)</div>
          <div>{</div>
          <div>    return 1;</div>
          <div>}</div>
        </div>
        <div><br>
        </div>
        <div>AVFormatContext *pIfmtCtx;</div>
        <div>
          <div>pIfmtCtx->flags |= AVFMT_FLAG_NONBLOCK;</div>
          <div>pIfmtCtx->interrupt_callback.callback =
            decodeInterruptCb;</div>
          <div>pIfmtCtx->interrupt_callback.opaque = NULL;</div>
        </div>
        <div><br>
        </div>
        <div>avformat_open_input(&pIfmtCtx, pInRtmpUrl, NULL, NULL);</div>
        <div><br>
        </div>
        <div>callback function is set that intends to return
          immediately, Why avformat_open_input() still waits for
          indefinite time?</div>
        <div><br>
        </div>
        <div>Is there something wrong with the usage of ffmpeg lib?</div>
        <div><br>
        </div>
        <div>Thanks!</div>
        <div><br>
        </div>
        <div>Regards</div>
        <div><br>
        </div>
        <div>Andrew</div>
      </div>
    </blockquote>
    I think ticket #5615 have the same/similar problem.<br>
    <a class="moz-txt-link-freetext" href="https://trac.ffmpeg.org/ticket/5615">https://trac.ffmpeg.org/ticket/5615</a><br>
    <br>
    If that is, please bump/update it.<br>
    Thanks<br>
  </body>
</html>