Is the avio_set_interrupt_cb deprecated in the new ffmpeg release? What is the substitute?
Asked
Active
Viewed 2,387 times
1 Answers
7
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.

jAckOdE
- 2,402
- 8
- 37
- 67
-
The answer was very helpful :) Thanks a lot. – progammer Jul 15 '13 at 06:35