summarylogtreecommitdiffstats
path: root/av_register_all.patch
blob: 649dfcf40672fad6eddc6f0445237e9d4a51cfa6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From 0094e5b4214cade58303cf315ce4c128d76f9e32 Mon Sep 17 00:00:00 2001
From: Alexandre Janniaux <ajanni@videolabs.io>
Date: Wed, 8 Apr 2020 15:07:15 +0200
Subject: [PATCH] avcodec: remove deprecation warning for av*_register_all
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From doc/APIchanges:

    2018-02-06 - 0694d87024 - lavf 58.9.100 - avformat.h
      Deprecate use of av_register_input_format(), av_register_output_format(),
      av_register_all(), av_iformat_next(), av_oformat_next().
      Add av_demuxer_iterate(), and av_muxer_iterate().

    2018-02-06 - 36c85d6e77 - lavc 58.10.100 - avcodec.h
      Deprecate use of avcodec_register(), avcodec_register_all(),
      av_codec_next(), av_register_codec_parser(), and av_parser_next().
      Add av_codec_iterate() and av_parser_iterate().

They are no-op since those updates. If compiling with a recent release,
just don't call av*_register_all to prevent warnings.

(cherry picked from commit 21d5a1933275edb7f67d05ea62a762464e07c2cb)
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
---
 modules/codec/avcodec/avcommon.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/codec/avcodec/avcommon.h b/modules/codec/avcodec/avcommon.h
index 8c8298014ff..158c01e3201 100644
--- a/modules/codec/avcodec/avcommon.h
+++ b/modules/codec/avcodec/avcommon.h
@@ -97,6 +97,7 @@ static inline void vlc_init_avutil(vlc_object_t *obj)
 
 #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
 # include <libavformat/avformat.h>
+# include <libavformat/version.h>
 static inline void vlc_init_avformat(vlc_object_t *obj)
 {
     vlc_avcodec_lock();
@@ -105,7 +106,9 @@ static inline void vlc_init_avformat(vlc_object_t *obj)
 
     avformat_network_init();
 
+#if (LIBAVFORMAT_VERSION_MICRO >= 100) && (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 100))
     av_register_all();
+#endif
 
     vlc_avcodec_unlock();
 }
@@ -113,13 +116,16 @@ static inline void vlc_init_avformat(vlc_object_t *obj)
 
 #ifdef HAVE_LIBAVCODEC_AVCODEC_H
 # include <libavcodec/avcodec.h>
+# include <libavcodec/version.h>
 static inline void vlc_init_avcodec(vlc_object_t *obj)
 {
     vlc_avcodec_lock();
 
     vlc_init_avutil(obj);
 
+#if (LIBAVFORMAT_VERSION_MICRO >= 100) && (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100))
     avcodec_register_all();
+#endif
 
     vlc_avcodec_unlock();
 }
-- 
GitLab