mirror of
https://github.com/mpv-player/mpv
synced 2024-12-21 06:14:32 +00:00
e0cf983e53
This used global variables for the asynchronous interrupt callback. Pick the simple and dumb solution and stuff the callback into mpv_global. Do this because interrupt checking should also work in the connect phase, and currently stream creation equates connecting. Ideally, this would be passed to the stream on creation instead, or connecting would be separated from creation. But since I don't know yet which is better, and since moving stream/demuxer into their own thread is something that will happen later, go with the mpv_global solution.
16 lines
359 B
C
16 lines
359 B
C
#ifndef MPV_MPV_H
|
|
#define MPV_MPV_H
|
|
|
|
// This should be accessed by glue code only, never normal code.
|
|
// The only purpose of this is to make mpv library-safe.
|
|
// Think hard before adding new members.
|
|
struct mpv_global {
|
|
struct MPOpts *opts;
|
|
struct mp_log *log;
|
|
|
|
int (*stream_interrupt_cb)(void *ctx);
|
|
void *stream_interrupt_cb_ctx;
|
|
};
|
|
|
|
#endif
|