This commit is contained in:
JerryXiao 2024-04-18 17:08:01 +08:00
commit cf926bfd57
Signed by: Jerry
GPG key ID: 22618F758B5BE2E5
2 changed files with 21 additions and 0 deletions

8
Makefile Normal file
View 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
View 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;
}