diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2018-02-18 20:11:37 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2018-02-18 19:12:18 +0000 |
commit | 237e296493d295647a6fbdb02e84f8f4c2a1c810 (patch) | |
tree | b3b5a02abd8a6032b9d9610963ed75dc6e356801 /package/kodi/files/kodi-shim.c | |
parent | c4c1d8df933930edddbba99c36ea2b588f28c6ef (diff) |
kodi: add aac workaround from Debian
Diffstat (limited to 'package/kodi/files/kodi-shim.c')
-rw-r--r-- | package/kodi/files/kodi-shim.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/package/kodi/files/kodi-shim.c b/package/kodi/files/kodi-shim.c new file mode 100644 index 000000000..952cb5660 --- /dev/null +++ b/package/kodi/files/kodi-shim.c @@ -0,0 +1,29 @@ +// from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=881536 + +#define _GNU_SOURCE +#include <dlfcn.h> +#include <stdint.h> + +// Mini version of AVPacket +typedef struct AVPacket { + void *buf; + int64_t pts; + int64_t dts; + uint8_t *data; + int size; +} AVPacket; + +int avcodec_decode_audio4(void* a, void* b, int* got_frame_ptr, const AVPacket* pkt) +{ + // Ignore null packets + if (pkt->size == 0) + { + *got_frame_ptr = 0; + return 0; + } + + // Forward to real function + int (*orig_decode)(void*, void*, int*, const AVPacket*) = + dlsym(RTLD_NEXT, "avcodec_decode_audio4"); + return orig_decode(a, b, got_frame_ptr, pkt); +} |