mirror of
https://github.com/asticode/go-astiav.git
synced 2025-09-27 04:26:30 +08:00
17 lines
378 B
C
17 lines
378 B
C
#include <libavformat/avio.h>
|
|
#include <libavutil/mem.h>
|
|
#include <stdatomic.h>
|
|
#include <stdlib.h>
|
|
|
|
int astiavInterruptCallback(void *ret)
|
|
{
|
|
return atomic_load((atomic_int*)ret);
|
|
}
|
|
|
|
AVIOInterruptCB* astiavNewInterruptCallback(atomic_int *ret)
|
|
{
|
|
AVIOInterruptCB* c = av_malloc(sizeof(AVIOInterruptCB));
|
|
c->callback = astiavInterruptCallback;
|
|
c->opaque = ret;
|
|
return c;
|
|
} |