Created
March 10, 2012 02:39
-
-
Save qrtt1/2009776 to your computer and use it in GitHub Desktop.
interrupt changes after ffmpeg n0.9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-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 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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