configure.ac: refactor avcodec check
Use PKG_HAVE_WITH_MODULES to declare the automake conditional and do the actual pkg-config lookup.
This will also change the output in case of failure, from:
checking for AVCODEC... no
configure: error: No package 'libavcodec' found
No package 'libavutil' found. Pass --disable-avcodec to ignore this error.
To:
checking for AVCODEC... no
configure: error: Package requirements (libavcodec >= 57.37.100 libavutil >= 55.22.101) were not met:
No package 'libavcodec' found
No package 'libavutil' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables AVCODEC_CFLAGS
and AVCODEC_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
make: *** [Makefile:1549: config.status] Error 1