[FFmpeg-cvslog] avformat/utils: Move ff_copy_whiteblacklists to avformat.c

Andreas Rheinhardt git at videolan.org
Tue May 10 09:36:09 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sat May  7 08:56:49 2022 +0200| [fc2fc98c7535b2984010155292efbe634b267485] | committer: Andreas Rheinhardt

avformat/utils: Move ff_copy_whiteblacklists to avformat.c

This is an auxiliary function for AVFormatContexts.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fc2fc98c7535b2984010155292efbe634b267485
---

 libavformat/avformat.c | 20 ++++++++++++++++++++
 libavformat/utils.c    | 21 ---------------------
 2 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/libavformat/avformat.c b/libavformat/avformat.c
index 414224187a..2249f09825 100644
--- a/libavformat/avformat.c
+++ b/libavformat/avformat.c
@@ -681,6 +681,26 @@ const AVCodec *ff_find_decoder(AVFormatContext *s, const AVStream *st,
     return avcodec_find_decoder(codec_id);
 }
 
+int ff_copy_whiteblacklists(AVFormatContext *dst, const AVFormatContext *src)
+{
+    av_assert0(!dst->codec_whitelist &&
+               !dst->format_whitelist &&
+               !dst->protocol_whitelist &&
+               !dst->protocol_blacklist);
+    dst-> codec_whitelist = av_strdup(src->codec_whitelist);
+    dst->format_whitelist = av_strdup(src->format_whitelist);
+    dst->protocol_whitelist = av_strdup(src->protocol_whitelist);
+    dst->protocol_blacklist = av_strdup(src->protocol_blacklist);
+    if (   (src-> codec_whitelist && !dst-> codec_whitelist)
+        || (src->  format_whitelist && !dst->  format_whitelist)
+        || (src->protocol_whitelist && !dst->protocol_whitelist)
+        || (src->protocol_blacklist && !dst->protocol_blacklist)) {
+        av_log(dst, AV_LOG_ERROR, "Failed to duplicate black/whitelist\n");
+        return AVERROR(ENOMEM);
+    }
+    return 0;
+}
+
 int ff_is_intra_only(enum AVCodecID id)
 {
     const AVCodecDescriptor *d = avcodec_descriptor_get(id);
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 866b80cffe..26f44ddfa1 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -23,7 +23,6 @@
 
 #include "config.h"
 
-#include "libavutil/avassert.h"
 #include "libavutil/avstring.h"
 #include "libavutil/bprint.h"
 #include "libavutil/internal.h"
@@ -56,26 +55,6 @@ int ff_unlock_avformat(void)
     return ff_mutex_unlock(&avformat_mutex) ? -1 : 0;
 }
 
-int ff_copy_whiteblacklists(AVFormatContext *dst, const AVFormatContext *src)
-{
-    av_assert0(!dst->codec_whitelist &&
-               !dst->format_whitelist &&
-               !dst->protocol_whitelist &&
-               !dst->protocol_blacklist);
-    dst-> codec_whitelist = av_strdup(src->codec_whitelist);
-    dst->format_whitelist = av_strdup(src->format_whitelist);
-    dst->protocol_whitelist = av_strdup(src->protocol_whitelist);
-    dst->protocol_blacklist = av_strdup(src->protocol_blacklist);
-    if (   (src-> codec_whitelist && !dst-> codec_whitelist)
-        || (src->  format_whitelist && !dst->  format_whitelist)
-        || (src->protocol_whitelist && !dst->protocol_whitelist)
-        || (src->protocol_blacklist && !dst->protocol_blacklist)) {
-        av_log(dst, AV_LOG_ERROR, "Failed to duplicate black/whitelist\n");
-        return AVERROR(ENOMEM);
-    }
-    return 0;
-}
-
 /* an arbitrarily chosen "sane" max packet size -- 50M */
 #define SANE_CHUNK_SIZE (50000000)
 



More information about the ffmpeg-cvslog mailing list