File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 1515#pragma clang diagnostic pop
1616#endif
1717
18+ #include <stdio.h>
1819#include <string.h>
1920
2021// For those building with an older version of dav1d (not recommended).
@@ -37,6 +38,12 @@ static void avifDav1dFreeCallback(const uint8_t * buf, void * cookie)
3738 (void )cookie ;
3839}
3940
41+ static void avifDav1dLogCallback (void * cookie , const char * format , va_list ap )
42+ {
43+ avifCodec * codec = (avifCodec * )cookie ;
44+ vsnprintf (codec -> diag -> error , AVIF_DIAGNOSTICS_ERROR_BUFFER_SIZE , format , ap );
45+ }
46+
4047static void dav1dCodecDestroyInternal (avifCodec * codec )
4148{
4249 if (codec -> internal -> hasPicture ) {
@@ -70,6 +77,8 @@ static avifBool dav1dCodecGetNextImage(struct avifCodec * codec,
7077 // a message, so we set frame_size_limit to at most 8192 * 8192 to avoid the dav1d_log
7178 // message.
7279 dav1dSettings .frame_size_limit = (sizeof (size_t ) < 8 ) ? AVIF_MIN (codec -> imageSizeLimit , 8192 * 8192 ) : codec -> imageSizeLimit ;
80+ dav1dSettings .logger .cookie = codec ;
81+ dav1dSettings .logger .callback = avifDav1dLogCallback ;
7382 dav1dSettings .operating_point = codec -> operatingPoint ;
7483 dav1dSettings .all_layers = codec -> allLayers ;
7584
You can’t perform that action at this time.
0 commit comments