Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the subtitute for avio_set_interrupt_cb?

Is the avio_set_interrupt_cb deprecated in the new ffmpeg release? What is the substitute?

like image 655
jAckOdE Avatar asked Oct 17 '25 11:10

jAckOdE


1 Answers

I found the answer myself. Here is how it's done

You define the call back

int decode_interrupt_cb(void * ctx) {
    return isQuit;
}

Make a call back struct

const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL };

Assign it to you AVFormatContext's interrupt_callback before any file reading

pFormatCtx->interrupt_callback = int_cb;

if you open file with 'avio_open2', use it like this:

int errCode = avio_open2(&pFormatCtx->pb, filename, AVIO_FLAG_READ, &pFormatCtx->interrupt_callback, NULL);

Hope someone find it helpful.

like image 91
jAckOdE Avatar answered Oct 21 '25 05:10

jAckOdE



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!