<div dir="ltr">Hi,<div>I'm trying to stop av_read_frame from blocking when the stream is stopped (stream over TCP, and the sender pauses sending).  Reading various forum posts, it would appear that I need to use the AVIOInterruptCB structure and assign it to my format context.  So I do this:</div><div><br></div><div><font face="monospace">    /* retrieve stream information */<br>    if (avformat_find_stream_info(fmt_ctx, NULL) < 0) {<br>        fprintf(stderr, "Could not find stream information\n");<br>        exit(1);<br>    }<br>    static const AVIOInterruptCB int_cb = {interrupt_cb, &int_cb_ctx};<br>    fmt_ctx->interrupt_callback = int_cb;</font><br></div><div><font face="monospace"><br></font></div><div><font face="arial, sans-serif">where interrupt_cb and int_cb_ctx are defined as:</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="monospace">static int interrupt_cb(void *ctx)<br>{<br>      int *p = (int *)ctx;<br>  *p = 53;<br>      return 1;<br>}<br><br>int int_cb_ctx = 0;<br></font><br></div><div>The only problem now is that av_read_frame still blocks, there's no evidence that interrupt_cb is being called, and I cannot restart my stream because my decoder gets stuck in av_read_frame.</div><div><br></div><div>Is there anything I am doing wrong?  Or is this a feature that has been deprecated?  Is there a better way of getting out of av_read_frame blocking?</div><div><br></div><div>Cheers,</div><div>Simon</div></div>