[FFmpeg-devel] [PATCH 1/3] lavf: add read_flush function to AVInputFormat vtable

rcombs rcombs at rcombs.me
Wed Feb 19 02:21:48 EET 2020


---
 libavformat/avformat.h | 6 ++++++
 libavformat/utils.c    | 4 ++++
 libavformat/version.h  | 4 ++--
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 9b9b634ec3..1412119342 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -780,6 +780,12 @@ typedef struct AVInputFormat {
      * @see avdevice_capabilities_free() for more details.
      */
     int (*free_device_capabilities)(struct AVFormatContext *s, struct AVDeviceCapabilitiesQuery *caps);
+
+    /**
+     * Flush demuxer-internal buffers ahead of a discontinuity in the input byte stream.
+     * @see avformat_flush() for more details.
+     */
+    void (*read_flush)(struct AVFormatContext *s);
 } AVInputFormat;
 /**
  * @}
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 123d67800b..c5fbe74c54 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2611,6 +2611,10 @@ int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts,
 int avformat_flush(AVFormatContext *s)
 {
     ff_read_frame_flush(s);
+
+    if (s->iformat->read_flush)
+        s->iformat->read_flush(s);
+
     return 0;
 }
 
diff --git a/libavformat/version.h b/libavformat/version.h
index 94fa57614d..741f2e30c5 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,8 +32,8 @@
 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
 // Also please add any ticket numbers that you believe might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  58
-#define LIBAVFORMAT_VERSION_MINOR  38
-#define LIBAVFORMAT_VERSION_MICRO 101
+#define LIBAVFORMAT_VERSION_MINOR  39
+#define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \
-- 
2.24.1


More information about the ffmpeg-devel mailing list