summaryrefslogtreecommitdiff
path: root/libswresample
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-06 11:43:18 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-05-10 06:49:32 +0200
commitf2b79c5b855b7450c8f3c15b9ec11b439cd2a294 (patch)
tree05bf29082809c5ad9051aa1c702135d7afd1555e /libswresample
parent3417379d5e85c026e6eda447ea7fcd3ccccead4a (diff)
downloadffmpeg-f2b79c5b855b7450c8f3c15b9ec11b439cd2a294.tar.gz
lib*/version: Move library version functions into files of their own
This avoids having to rebuild big files every time FFMPEG_VERSION changes (which it does with every commit). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libswresample')
-rw-r--r--libswresample/Makefile1
-rw-r--r--libswresample/swresample.c21
-rw-r--r--libswresample/version.c45
3 files changed, 46 insertions, 21 deletions
diff --git a/libswresample/Makefile b/libswresample/Makefile
index b74ee20987..dc80027c35 100644
--- a/libswresample/Makefile
+++ b/libswresample/Makefile
@@ -14,6 +14,7 @@ OBJS = audioconvert.o \
resample_dsp.o \
swresample.o \
swresample_frame.o \
+ version.o \
OBJS-$(CONFIG_LIBSOXR) += soxr_resample.o
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index be59b69b73..9b77ef65bf 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -24,32 +24,11 @@
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/internal.h"
-#include "version.h"
#include <float.h>
#define ALIGN 32
-#include "libavutil/ffversion.h"
-const char swr_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
-
-unsigned swresample_version(void)
-{
- av_assert0(LIBSWRESAMPLE_VERSION_MICRO >= 100);
- return LIBSWRESAMPLE_VERSION_INT;
-}
-
-const char *swresample_configuration(void)
-{
- return FFMPEG_CONFIGURATION;
-}
-
-const char *swresample_license(void)
-{
-#define LICENSE_PREFIX "libswresample license: "
- return &LICENSE_PREFIX FFMPEG_LICENSE[sizeof(LICENSE_PREFIX) - 1];
-}
-
int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map){
if(!s || s->in_convert) // s needs to be allocated but not initialized
return AVERROR(EINVAL);
diff --git a/libswresample/version.c b/libswresample/version.c
new file mode 100644
index 0000000000..00f71e3393
--- /dev/null
+++ b/libswresample/version.c
@@ -0,0 +1,45 @@
+/*
+ * Version functions.
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "libavutil/avassert.h"
+#include "swresample.h"
+#include "version.h"
+
+#include "libavutil/ffversion.h"
+const char swr_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
+
+unsigned swresample_version(void)
+{
+ av_assert0(LIBSWRESAMPLE_VERSION_MICRO >= 100);
+ return LIBSWRESAMPLE_VERSION_INT;
+}
+
+const char *swresample_configuration(void)
+{
+ return FFMPEG_CONFIGURATION;
+}
+
+const char *swresample_license(void)
+{
+#define LICENSE_PREFIX "libswresample license: "
+ return &LICENSE_PREFIX FFMPEG_LICENSE[sizeof(LICENSE_PREFIX) - 1];
+}
+