[FFmpeg-devel] [PATCH 3/3] lavc, lavd, lavf, lavfi, tests: remove several register() calls

Josh de Kock josh at itanimul.li
Sun Feb 18 19:58:19 EET 2018


---
 libavdevice/lavfi.c              | 2 --
 libavfilter/lavfutils.c          | 2 --
 libavfilter/src_movie.c          | 2 --
 libavfilter/tests/filtfmts.c     | 2 --
 libavformat/tests/movenc.c       | 2 --
 libavformat/tests/seek.c         | 3 ---
 tests/api/api-band-test.c        | 2 --
 tests/api/api-codec-param-test.c | 2 --
 tests/api/api-flac-test.c        | 2 --
 tests/api/api-h264-test.c        | 2 --
 tests/api/api-seek-test.c        | 2 --
 tools/aviocat.c                  | 1 -
 tools/enum_options.c             | 2 --
 tools/graph2dot.c                | 2 --
 tools/ismindex.c                 | 2 --
 tools/pktdumper.c                | 3 ---
 tools/probetest.c                | 3 ---
 tools/seek_print.c               | 1 -
 tools/sidxindex.c                | 2 --
 tools/uncoded_frame.c            | 4 ----
 20 files changed, 43 deletions(-)

diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index 6f2ae95..ca8f05f 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -130,8 +130,6 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
     if (!pix_fmts)
         FAIL(AVERROR(ENOMEM));
 
-    avfilter_register_all();
-
     buffersink = avfilter_get_by_name("buffersink");
     abuffersink = avfilter_get_by_name("abuffersink");
 
diff --git a/libavfilter/lavfutils.c b/libavfilter/lavfutils.c
index b6319cf..db4b69b 100644
--- a/libavfilter/lavfutils.c
+++ b/libavfilter/lavfutils.c
@@ -37,8 +37,6 @@ int ff_load_image(uint8_t *data[4], int linesize[4],
 
     av_init_packet(&pkt);
 
-    av_register_all();
-
     iformat = av_find_input_format("image2pipe");
     if ((ret = avformat_open_input(&format_ctx, filename, iformat, NULL)) < 0) {
         av_log(log_ctx, AV_LOG_ERROR,
diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index 258ba50..bcabfcc 100644
--- a/libavfilter/src_movie.c
+++ b/libavfilter/src_movie.c
@@ -239,8 +239,6 @@ static av_cold int movie_common_init(AVFilterContext *ctx)
         return AVERROR_PATCHWELCOME;
     }
 
-    av_register_all();
-
     // Try to find the movie format (container)
     iformat = movie->format_name ? av_find_input_format(movie->format_name) : NULL;
 
diff --git a/libavfilter/tests/filtfmts.c b/libavfilter/tests/filtfmts.c
index 72b860a..a958621 100644
--- a/libavfilter/tests/filtfmts.c
+++ b/libavfilter/tests/filtfmts.c
@@ -97,8 +97,6 @@ int main(int argc, char **argv)
     if (!graph_ctx)
         return 1;
 
-    avfilter_register_all();
-
     /* get a corresponding filter and open it */
     if (!(filter = avfilter_get_by_name(filter_name))) {
         fprintf(stderr, "Unrecognized filter with name '%s'\n", filter_name);
diff --git a/libavformat/tests/movenc.c b/libavformat/tests/movenc.c
index ad6c92a..1d15d97 100644
--- a/libavformat/tests/movenc.c
+++ b/libavformat/tests/movenc.c
@@ -379,8 +379,6 @@ int main(int argc, char **argv)
         }
     }
 
-    av_register_all();
-
     md5 = av_md5_alloc();
     if (!md5)
         return 1;
diff --git a/libavformat/tests/seek.c b/libavformat/tests/seek.c
index 7ed56ba..e0067a6 100644
--- a/libavformat/tests/seek.c
+++ b/libavformat/tests/seek.c
@@ -91,9 +91,6 @@ int main(int argc, char **argv)
     av_dict_set(&format_opts, "channels", "1", 0);
     av_dict_set(&format_opts, "sample_rate", "22050", 0);
 
-    /* initialize libavcodec, and register all codecs and formats */
-    av_register_all();
-
     if (argc < 2) {
         printf("usage: %s input_file\n"
                "\n", argv[0]);
diff --git a/tests/api/api-band-test.c b/tests/api/api-band-test.c
index 5ccba4f..a84f6b7 100644
--- a/tests/api/api-band-test.c
+++ b/tests/api/api-band-test.c
@@ -214,8 +214,6 @@ int main(int argc, char **argv)
         return 1;
     }
 
-    av_register_all();
-
     if (video_decode(argv[1]) != 0)
         return 1;
 
diff --git a/tests/api/api-codec-param-test.c b/tests/api/api-codec-param-test.c
index 377a5e9..0868322 100644
--- a/tests/api/api-codec-param-test.c
+++ b/tests/api/api-codec-param-test.c
@@ -231,8 +231,6 @@ int main(int argc, char* argv[])
     AVFormatContext *fmt_ctx = NULL;
     AVFormatContext *fmt_ctx_no_decode = NULL;
 
-    av_register_all();
-
     if (argc < 2) {
         av_log(NULL, AV_LOG_ERROR, "Usage: %s <input>\n", argv[0]);
         return -1;
diff --git a/tests/api/api-flac-test.c b/tests/api/api-flac-test.c
index c5a37f0..2e90812 100644
--- a/tests/api/api-flac-test.c
+++ b/tests/api/api-flac-test.c
@@ -245,8 +245,6 @@ int main(void)
     int sample_rates[] = {8000, 44100, 48000, 192000};
     int cl, sr;
 
-    avcodec_register_all();
-
     enc = avcodec_find_encoder(AV_CODEC_ID_FLAC);
     if (!enc) {
         av_log(NULL, AV_LOG_ERROR, "Can't find encoder\n");
diff --git a/tests/api/api-h264-test.c b/tests/api/api-h264-test.c
index 52282e0..66669fa 100644
--- a/tests/api/api-h264-test.c
+++ b/tests/api/api-h264-test.c
@@ -158,8 +158,6 @@ int main(int argc, char **argv)
         return 1;
     }
 
-    av_register_all();
-
     if (video_decode_example(argv[1]) != 0)
         return 1;
 
diff --git a/tests/api/api-seek-test.c b/tests/api/api-seek-test.c
index 2b32cb9..d0531a2 100644
--- a/tests/api/api-seek-test.c
+++ b/tests/api/api-seek-test.c
@@ -279,8 +279,6 @@ int main(int argc, char **argv)
         return 1;
     }
 
-    av_register_all();
-
     if (seek_test(argv[1], argv[2], argv[3]) != 0)
         return 1;
 
diff --git a/tools/aviocat.c b/tools/aviocat.c
index 28529b0..2aa08b9 100644
--- a/tools/aviocat.c
+++ b/tools/aviocat.c
@@ -42,7 +42,6 @@ int main(int argc, char **argv)
     AVDictionary *in_opts = NULL;
     AVDictionary *out_opts = NULL;
 
-    av_register_all();
     avformat_network_init();
 
     for (i = 1; i < argc; i++) {
diff --git a/tools/enum_options.c b/tools/enum_options.c
index c2a295c..77e1f9f 100644
--- a/tools/enum_options.c
+++ b/tools/enum_options.c
@@ -130,8 +130,6 @@ int main(int argc, char **argv)
     if (argc < 2)
         print_usage();
 
-    av_register_all();
-
     if (!strcmp(argv[1], "format"))
         show_format_opts();
     else if (!strcmp(argv[1], "codec"))
diff --git a/tools/graph2dot.c b/tools/graph2dot.c
index 21d0795..d5c1e4e 100644
--- a/tools/graph2dot.c
+++ b/tools/graph2dot.c
@@ -189,8 +189,6 @@ int main(int argc, char **argv)
         *p = '\0';
     }
 
-    avfilter_register_all();
-
     if (avfilter_graph_parse(graph, graph_string, NULL, NULL, NULL) < 0) {
         fprintf(stderr, "Failed to parse the graph description\n");
         return 1;
diff --git a/tools/ismindex.c b/tools/ismindex.c
index 0254a98..7601f62 100644
--- a/tools/ismindex.c
+++ b/tools/ismindex.c
@@ -791,8 +791,6 @@ int main(int argc, char **argv)
     int split = 0, ismf = 0, i;
     struct Tracks tracks = { 0, .video_track = -1, .audio_track = -1 };
 
-    av_register_all();
-
     for (i = 1; i < argc; i++) {
         if (!strcmp(argv[i], "-n")) {
             basename = argv[i + 1];
diff --git a/tools/pktdumper.c b/tools/pktdumper.c
index 6516ad3..16a965b 100644
--- a/tools/pktdumper.c
+++ b/tools/pktdumper.c
@@ -89,9 +89,6 @@ int main(int argc, char **argv)
     strcat(fntemplate, PKTFILESUFF);
     printf("FNTEMPLATE: '%s'\n", fntemplate);
 
-    // register all file formats
-    av_register_all();
-
     err = avformat_open_input(&fctx, argv[1], NULL, NULL);
     if (err < 0) {
         fprintf(stderr, "cannot open input: error %d\n", err);
diff --git a/tools/probetest.c b/tools/probetest.c
index 74045eb..2c6c1de 100644
--- a/tools/probetest.c
+++ b/tools/probetest.c
@@ -124,9 +124,6 @@ int main(int argc, char **argv)
         return 1;
     }
 
-    avcodec_register_all();
-    av_register_all();
-
     av_lfg_init(&state, 0xdeadbeef);
 
     pd.buf = NULL;
diff --git a/tools/seek_print.c b/tools/seek_print.c
index de876b4..9280421 100644
--- a/tools/seek_print.c
+++ b/tools/seek_print.c
@@ -65,7 +65,6 @@ int main(int argc, char **argv)
     argv++;
     argc--;
 
-    av_register_all();
     if ((ret = avformat_open_input(&avf, filename, NULL, NULL)) < 0) {
         fprintf(stderr, "%s: %s\n", filename, av_err2str(ret));
         return 1;
diff --git a/tools/sidxindex.c b/tools/sidxindex.c
index be28461..a4f9551 100644
--- a/tools/sidxindex.c
+++ b/tools/sidxindex.c
@@ -363,8 +363,6 @@ int main(int argc, char **argv)
     struct Tracks tracks = { 0 };
     int i;
 
-    av_register_all();
-
     for (i = 1; i < argc; i++) {
         if (!strcmp(argv[i], "-out")) {
             out = argv[i + 1];
diff --git a/tools/uncoded_frame.c b/tools/uncoded_frame.c
index 3aaa4b6..efea445 100644
--- a/tools/uncoded_frame.c
+++ b/tools/uncoded_frame.c
@@ -62,10 +62,6 @@ int main(int argc, char **argv)
     out_dev_name = argv + 2;
     nb_out_dev = argc - 2;
 
-    av_register_all();
-    avdevice_register_all();
-    avfilter_register_all();
-
     /* Create input graph */
     if (!(in_graph = avfilter_graph_alloc())) {
         ret = AVERROR(ENOMEM);
-- 
2.7.4



More information about the ffmpeg-devel mailing list