-if test $with_libavcodec = "no" ; then {
- AM_CONDITIONAL(WITH_LIBAVCODEC,false)
-} else {
+
+if test $with_libavcodec != "no" ; then {
+ PKG_CHECK_MODULES(LIBAVCODEC, libavcodec,[with_libavcodec="yes"],[with_libavcodec="no"])
+} ; fi
+if test $with_libavcodec != "no" ; then {
+ PKG_CHECK_MODULES(LIBAVFORMAT, libavformat,[with_libavcodec="yes"],[with_libavcodec="no"])
+} ; fi
+if test $with_libavcodec = "yes" ; then {
+ AC_DEFINE(WITH_LIBAVCODEC,[],[enable libavcodec support])