build: Use pkg-config for openjpeg

Bug-Id: 387
CC: libav-stable@libav.org
vda: Unbroken
vda: Fix last frame handling

Otherwise it would segfault.