Kagami / go-avif

:art: Go AVIF library
Creative Commons Zero v1.0 Universal
314 stars 22 forks source link

Shouldn't be using an unbounded number of threads #7

Closed flx42 closed 4 years ago

flx42 commented 4 years ago

Thanks for the useful example program @Kagami! Just a quick bug report for this line: https://github.com/Kagami/go-avif/blob/6487e4d17d12e21051bd13b36bcb6ec95b4c3418/avif.go#L115

On a machine with a large number of CPU cores, libaom will fail to initialize since the context is using too many threads: https://aomedia.googlesource.com/aom/+/6397132dc7fecad9cef87007366213efb6b9f800/av1/av1_cx_iface.c#365

Where MAX_NUM_THREADS is 64: https://aomedia.googlesource.com/aom/+/6397132dc7fecad9cef87007366213efb6b9f800/aom_util/aom_thread.h#29

Kagami commented 4 years ago

Fixed, thanks