init
This commit is contained in:
commit
cf926bfd57
2 changed files with 21 additions and 0 deletions
8
Makefile
Normal file
8
Makefile
Normal file
|
@ -0,0 +1,8 @@
|
|||
CC ?= gcc
|
||||
CFLAGS += -fPIC -shared
|
||||
nyav1.so:
|
||||
$(CC) $(CFLAGS) nyav1.c -o nyav1.so
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f nyav1.so
|
13
nyav1.c
Normal file
13
nyav1.c
Normal file
|
@ -0,0 +1,13 @@
|
|||
#include <stdio.h>
|
||||
#include <dlfcn.h>
|
||||
static int (*old) (void *a, void *b) = NULL;
|
||||
int dav1d_open (void *a, void *b) {
|
||||
int max_frame_delay = *(((int*)b)+1);
|
||||
if (max_frame_delay == 1) {
|
||||
if (!old) old = dlsym(RTLD_NEXT, "dav1d_open");
|
||||
printf("dav1d_open passthrough, max_frame_delay=%d\n", max_frame_delay);
|
||||
return old(a, b);
|
||||
}
|
||||
printf("dav1d_open force -1, max_frame_delay=%d\n", max_frame_delay);
|
||||
return -1;
|
||||
}
|
Loading…
Reference in a new issue