Skip to content

Instantly share code, notes, and snippets.

@qrtt1
Created March 10, 2012 02:39
Show Gist options
  • Save qrtt1/2009776 to your computer and use it in GitHub Desktop.
Save qrtt1/2009776 to your computer and use it in GitHub Desktop.
interrupt changes after ffmpeg n0.9
-static int decode_interrupt_cb(void)
+static int decode_interrupt_cb(void *ctx)
{
- q_pressed += read_key() == 'q';
- return q_pressed > 1;
+ return received_nb_signals > 1;
}
-static int ffmpeg_exit(int ret)
+static const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL };
// set callback to AVFormatContext*->interrupt_callback
// callback type=> int (*interrupt_cb)(void*)
// interrupt_callback type=> AVIOInterruptCB
// ex: static const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL };
oc->interrupt_callback = int_cb;
// set global callback (old style)
// callback type=> int (*interrupt_cb)(void)
avio_set_interrupt_cb(decode_interrupt_cb);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment