[FFmpeg-cvslog] avformat: add avformat_flush()
wm4
git at videolan.org
Thu Mar 5 00:26:36 CET 2015
ffmpeg | branch: master | wm4 <nfxjfg at googlemail.com> | Tue Sep 30 18:46:49 2014 +0200| [cca44764b9def05d90d051b24a84369f9891a460] | committer: Michael Niedermayer
avformat: add avformat_flush()
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cca44764b9def05d90d051b24a84369f9891a460
---
doc/APIchanges | 3 +++
libavformat/avformat.h | 17 +++++++++++++++++
libavformat/utils.c | 6 ++++++
libavformat/version.h | 4 ++--
4 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges
index 6875aed..7ceee3e 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2014-08-09
API changes, most recent first:
+2015-03-04 - xxxxxxx - lavf 56.25.100
+ Add avformat_flush()
+
2015-03-xx - xxxxxxx - lavf 56.24.100
Add avio_put_str16be()
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index a5d2dd9..e47df05 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2137,6 +2137,23 @@ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp,
int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
/**
+ * Discard all internally buffered data. This can be useful when dealing with
+ * discontinuities in the byte stream. Generally works only with headerless
+ * formats.
+ *
+ * The set of streams, the detected duration, stream parameters and codecs do
+ * not change when calling this function. If you want a complete reset, it's
+ * better to open a new AVFormatContext.
+ *
+ * This does not flush the AVIOContext (s->pb). If necessary, call
+ * avio_flush(s->pb) before calling this function.
+ *
+ * @param s media file handle
+ * @return >=0 on success, error code otherwise
+ */
+int avformat_flush(AVFormatContext *s);
+
+/**
* Start playing a network-based stream (e.g. RTSP stream) at the
* current position.
*/
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 917f8ce..17ae300 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2201,6 +2201,12 @@ int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts,
return -1; //unreachable
}
+int avformat_flush(AVFormatContext *s)
+{
+ ff_read_frame_flush(s);
+ return 0;
+}
+
/*******************************************************/
/**
diff --git a/libavformat/version.h b/libavformat/version.h
index 6a5c3d5..90ed844 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,8 +30,8 @@
#include "libavutil/version.h"
#define LIBAVFORMAT_VERSION_MAJOR 56
-#define LIBAVFORMAT_VERSION_MINOR 24
-#define LIBAVFORMAT_VERSION_MICRO 101
+#define LIBAVFORMAT_VERSION_MINOR 25
+#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
More information about the ffmpeg-cvslog
mailing list