diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/av_log.c | 23 | ||||
-rw-r--r-- | common/recorder.c | 2 |
2 files changed, 4 insertions, 21 deletions
diff --git a/common/av_log.c b/common/av_log.c index 8b0cb09efa..d7df24e05c 100644 --- a/common/av_log.c +++ b/common/av_log.c @@ -35,6 +35,7 @@ #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> +#include <libswresample/swresample.h> #include <libswscale/swscale.h> #include <libavfilter/avfilter.h> @@ -42,18 +43,6 @@ #include <libavdevice/avdevice.h> #endif -#if HAVE_LIBAV -#include <libavresample/avresample.h> -#else -#include <libswresample/swresample.h> -#endif - -#if LIBAVCODEC_VERSION_MICRO >= 100 -#define LIB_PREFIX "ffmpeg" -#else -#define LIB_PREFIX "libav" -#endif - // Needed because the av_log callback does not provide a library-safe message // callback. static pthread_mutex_t log_lock = PTHREAD_MUTEX_INITIALIZER; @@ -151,7 +140,7 @@ void init_libav(struct mpv_global *global) pthread_mutex_lock(&log_lock); if (!log_mpv_instance) { log_mpv_instance = global; - log_root = mp_log_new(NULL, global->log, LIB_PREFIX); + log_root = mp_log_new(NULL, global->log, "ffmpeg"); log_decaudio = mp_log_new(log_root, log_root, "audio"); log_decvideo = mp_log_new(log_root, log_root, "video"); log_demuxer = mp_log_new(log_root, log_root, "demuxer"); @@ -195,14 +184,10 @@ bool print_libav_versions(struct mp_log *log, int v) {"libavformat", LIBAVFORMAT_VERSION_INT, avformat_version()}, {"libswscale", LIBSWSCALE_VERSION_INT, swscale_version()}, {"libavfilter", LIBAVFILTER_VERSION_INT, avfilter_version()}, -#if HAVE_LIBAV - {"libavresample", LIBAVRESAMPLE_VERSION_INT, avresample_version()}, -#else {"libswresample", LIBSWRESAMPLE_VERSION_INT, swresample_version()}, -#endif }; - mp_msg(log, v, "%s library versions:\n", LIB_PREFIX); + mp_msg(log, v, "FFmpeg library versions:\n"); bool mismatch = false; for (int n = 0; n < MP_ARRAY_SIZE(libs); n++) { @@ -216,7 +201,7 @@ bool print_libav_versions(struct mp_log *log, int v) mp_msg(log, v, "\n"); } - mp_msg(log, v, "%s version: %s\n", LIB_PREFIX, av_version_info()); + mp_msg(log, v, "FFmpeg version: %s\n", av_version_info()); return !mismatch; } diff --git a/common/recorder.c b/common/recorder.c index 1af736a71d..58bf257883 100644 --- a/common/recorder.c +++ b/common/recorder.c @@ -91,14 +91,12 @@ static int add_stream(struct mp_recorder *priv, struct sh_stream *sh) if (!avp) return -1; -#if LIBAVCODEC_VERSION_MICRO >= 100 // We don't know the delay, so make something up. If the format requires // DTS, the result will probably be broken. FFmpeg provides nothing better // yet (unless you demux with libavformat, which contains tons of hacks // that try to determine a PTS). if (!sh->codec->lav_codecpar) avp->video_delay = 16; -#endif if (avp->codec_id == AV_CODEC_ID_NONE) return -1; |