diff mbox series

[FFmpeg-devel,48/87] avformat: Remove deprecated av_demuxer_open()

Message ID 20210419141024.8174-49-jamrial@gmail.com
State Accepted
Commit 0a071f7124beaf0929f772a8618ac1b6c17b0222
Headers show
Series Major bump
Related show

Checks

Context Check Description
andriy/configure warning Failed to apply patch
andriy/configure warning Failed to apply patch

Commit Message

James Almer April 19, 2021, 2:09 p.m. UTC
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

Deprecate in e37f161e66e042d6c2c7470c4d9881df9427fc4a.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/avformat.h | 10 +---------
 libavformat/utils.c    | 29 -----------------------------
 libavformat/version.h  |  3 ---
 3 files changed, 1 insertion(+), 41 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 6658a0f315..272370db2a 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1276,7 +1276,7 @@  typedef struct AVFormatContext {
 #define AVFMT_FLAG_BITEXACT         0x0400
 #define AVFMT_FLAG_SORT_DTS    0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down)
 #if FF_API_LAVF_PRIV_OPT
-#define AVFMT_FLAG_PRIV_OPT    0x20000 ///< Enable use of private options by delaying codec open (deprecated, will do nothing once av_demuxer_open() is removed)
+#define AVFMT_FLAG_PRIV_OPT    0x20000 ///< Enable use of private options by delaying codec open (deprecated, does nothing)
 #endif
 #define AVFMT_FLAG_FAST_SEEK   0x80000 ///< Enable fast, but inaccurate seeks for some formats
 #define AVFMT_FLAG_SHORTEST   0x100000 ///< Stop muxing when the shortest stream stops.
@@ -2017,14 +2017,6 @@  int av_probe_input_buffer(AVIOContext *pb, const AVInputFormat **fmt,
 int avformat_open_input(AVFormatContext **ps, const char *url,
                         const AVInputFormat *fmt, AVDictionary **options);
 
-#if FF_API_DEMUXER_OPEN
-/**
- * @deprecated Use an AVDictionary to pass options to a demuxer.
- */
-attribute_deprecated
-int av_demuxer_open(AVFormatContext *ic);
-#endif
-
 /**
  * Read packets of a media file to get stream information. This
  * is useful for file formats with no headers such as MPEG. This
diff --git a/libavformat/utils.c b/libavformat/utils.c
index d8b44ce896..ba664f6214 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -370,27 +370,6 @@  FF_ENABLE_DEPRECATION_WARNINGS
 /************************************************************/
 /* input media file */
 
-#if FF_API_DEMUXER_OPEN
-int av_demuxer_open(AVFormatContext *ic) {
-    int err;
-
-    if (ic->format_whitelist && av_match_list(ic->iformat->name, ic->format_whitelist, ',') <= 0) {
-        av_log(ic, AV_LOG_ERROR, "Format not on whitelist \'%s\'\n", ic->format_whitelist);
-        return AVERROR(EINVAL);
-    }
-
-    if (ic->iformat->read_header) {
-        err = ic->iformat->read_header(ic);
-        if (err < 0)
-            return err;
-    }
-
-    if (ic->pb && !ic->internal->data_offset)
-        ic->internal->data_offset = avio_tell(ic->pb);
-
-    return 0;
-}
-#endif
 /* Open input file and probe the format if necessary. */
 static int init_input(AVFormatContext *s, const char *filename,
                       AVDictionary **options)
@@ -603,11 +582,7 @@  int avformat_open_input(AVFormatContext **ps, const char *filename,
     if (s->pb)
         ff_id3v2_read_dict(s->pb, &s->internal->id3v2_meta, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
 
-#if FF_API_DEMUXER_OPEN
-    if (!(s->flags&AVFMT_FLAG_PRIV_OPT) && s->iformat->read_header)
-#else
     if (s->iformat->read_header)
-#endif
         if ((ret = s->iformat->read_header(s)) < 0)
             goto fail;
 
@@ -636,11 +611,7 @@  int avformat_open_input(AVFormatContext **ps, const char *filename,
     if ((ret = avformat_queue_attached_pictures(s)) < 0)
         goto close;
 
-#if FF_API_DEMUXER_OPEN
-    if (!(s->flags&AVFMT_FLAG_PRIV_OPT) && s->pb && !s->internal->data_offset)
-#else
     if (s->pb && !s->internal->data_offset)
-#endif
         s->internal->data_offset = avio_tell(s->pb);
 
     s->internal->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
diff --git a/libavformat/version.h b/libavformat/version.h
index 7ce6660f43..70ac403a53 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -58,9 +58,6 @@ 
 #ifndef FF_API_LAVF_AVCTX
 #define FF_API_LAVF_AVCTX               (LIBAVFORMAT_VERSION_MAJOR < 59)
 #endif
-#ifndef FF_API_DEMUXER_OPEN
-#define FF_API_DEMUXER_OPEN             (LIBAVFORMAT_VERSION_MAJOR < 59)
-#endif
 #ifndef FF_API_CHAPTER_ID_INT
 #define FF_API_CHAPTER_ID_INT           (LIBAVFORMAT_VERSION_MAJOR < 59)
 #endif