[vlc-commits] [Git][videolan/vlc][master] 2 commits: codec/avcodec: remove avutil version check

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Wed Aug 11 20:35:38 UTC 2021



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
f6165fc8 by Marvin Scholz at 2021-08-11T18:38:21+00:00
codec/avcodec: remove avutil version check

The avutil version is always higher or equal to 55 with the
versions of ffmpeg/libav required in configure.

- - - - -
f31d58a4 by Marvin Scholz at 2021-08-11T18:38:21+00:00
ffmpeg: remove unnecessary header checks

When avcodec is found, it does not really add much value to check for
the avcodec header. avutil is required by it, so checking for that
is not needed either.

For avformat, avcodec is required, therefore checking for
avcodec and avutil headers is not needed there either.

Conditionally including those in avcommon_compat.h does not
seem needed at all, as it won't compile without these headers
anyway.

- - - - -


3 changed files:

- configure.ac
- modules/codec/avcodec/avcommon.h
- modules/codec/avcodec/avcommon_compat.h


Changes:

=====================================
configure.ac
=====================================
@@ -2492,12 +2492,6 @@ AS_IF([test "${enable_avcodec}" != "no"], [
     *) AC_MSG_ERROR([Missing libav or FFmpeg. Pass --disable-avcodec to ignore this error.])
   esac
   PKG_CHECK_MODULES(AVCODEC,[libavcodec >= ${av_codec_ver} libavutil >= 55.9.0], [
-    VLC_SAVE_FLAGS
-    CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
-    CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
-    AC_CHECK_HEADERS([libavcodec/avcodec.h])
-    AC_CHECK_HEADERS([libavutil/avutil.h])
-    VLC_RESTORE_FLAGS
     have_avcodec="yes"
   ],[
     AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
@@ -2691,8 +2685,6 @@ AS_IF([test "${enable_avformat}" != "no"], [
       CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
       CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
       AC_CHECK_HEADERS([libavformat/avformat.h libavformat/avio.h])
-      AC_CHECK_HEADERS([libavcodec/avcodec.h])
-      AC_CHECK_HEADERS([libavutil/avutil.h])
       AS_IF([test "$enable_merge_ffmpeg" = "no"], [
         have_avformat="no"
       ])


=====================================
modules/codec/avcodec/avcommon.h
=====================================
@@ -36,7 +36,6 @@
 
 #include "avcommon_compat.h"
 
-#ifdef HAVE_LIBAVUTIL_AVUTIL_H
 # include <libavutil/avutil.h>
 # include <libavutil/dict.h>
 # include <libavutil/cpu.h>
@@ -70,11 +69,11 @@ static inline void vlc_av_get_options(const char *psz_opts, AVDictionary** pp_di
 {
     config_chain_t *cfg = NULL;
     config_ChainParseOptions(&cfg, psz_opts);
-    for (config_chain_t *item = cfg; item != NULL; item = item->p_next) {
-        av_dict_set(pp_dict, item->psz_name, item->psz_value, 0);
+    for (config_chain_t *item = cfg; item != NULL; item = item->p_next) {
+        av_dict_set(pp_dict, item->psz_name, item->psz_value, 0);
     }
-    if (cfg)
-        config_ChainDestroy(cfg);
+    if (cfg)
+        config_ChainDestroy(cfg);
 }
 
 static inline void vlc_init_avutil(vlc_object_t *obj)
@@ -106,7 +105,6 @@ static inline void vlc_init_avutil(vlc_object_t *obj)
 
     msg_Dbg(obj, "CPU flags: 0x%08x", av_get_cpu_flags());
 }
-#endif
 
 #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
 # include <libavformat/avformat.h>
@@ -127,7 +125,6 @@ static inline void vlc_init_avformat(vlc_object_t *obj)
 }
 #endif
 
-#ifdef HAVE_LIBAVCODEC_AVCODEC_H
 # include <libavcodec/avcodec.h>
 # include <libavcodec/version.h>
 static inline void vlc_init_avcodec(vlc_object_t *obj)
@@ -142,7 +139,6 @@ static inline void vlc_init_avcodec(vlc_object_t *obj)
 
     vlc_avcodec_unlock();
 }
-#endif
 
 #ifndef AV_ERROR_MAX_STRING_SIZE
  #define AV_ERROR_MAX_STRING_SIZE 64


=====================================
modules/codec/avcodec/avcommon_compat.h
=====================================
@@ -26,7 +26,6 @@
 
 #define AVPROVIDER(lib) ((lib##_VERSION_MICRO < 100) ? "libav" : "ffmpeg")
 
-#ifdef HAVE_LIBAVCODEC_AVCODEC_H
 #include <libavcodec/avcodec.h>
 
 /* LIBAVCODEC_VERSION_CHECK checks for the right version of libav and FFmpeg
@@ -77,9 +76,6 @@
 # define  FF_MAX_B_FRAMES 16 // FIXME: remove this
 #endif
 
-#endif /* HAVE_LIBAVCODEC_AVCODEC_H */
-
-#ifdef HAVE_LIBAVUTIL_AVUTIL_H
 # include <libavutil/avutil.h>
 
 /* LIBAVUTIL_VERSION_CHECK checks for the right version of libav and FFmpeg
@@ -90,12 +86,6 @@
     ( (LIBAVUTIL_VERSION_MICRO <  100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
       (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) )
 
-#endif /* HAVE_LIBAVUTIL_AVUTIL_H */
-
-#if LIBAVUTIL_VERSION_MAJOR >= 55
-# define FF_API_AUDIOCONVERT 1
-#endif
-
 #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
 # include <libavformat/avformat.h>
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/19875f31674b2bd4058b72dc4dfb19cc2b7669b0...f31d58a4c8f1ff6ff9dd85d3e72e8a7c43180b48

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/19875f31674b2bd4058b72dc4dfb19cc2b7669b0...f31d58a4c8f1ff6ff9dd85d3e72e8a7c43180b48
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list