From 399301fd74ed748d24d7ee2806f50e8ad57aeea8 Mon Sep 17 00:00:00 2001 From: elupus Date: Tue, 1 Nov 2011 20:18:35 +0100 Subject: [PATCH 24/24] add public version of ff_read_frame_flush We need this since we sometimes seek on the input stream behind ffmpeg's back. After this all data need to be flushed completely. --- libavformat/avformat.h | 5 +++++ libavformat/utils.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 1e8a629..c76ac71 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1631,6 +1631,11 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt); int av_read_frame(AVFormatContext *s, AVPacket *pkt); /** + * Clear out any buffered data in context + */ +void av_read_frame_flush(AVFormatContext *s); + +/** * Seek to the keyframe at timestamp. * 'timestamp' in 'stream_index'. * @param stream_index If stream_index is (-1), a default diff --git a/libavformat/utils.c b/libavformat/utils.c index 25fe38e..4729a40 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1463,6 +1463,11 @@ void ff_read_frame_flush(AVFormatContext *s) } } +void av_read_frame_flush(AVFormatContext *s) +{ + ff_read_frame_flush(s); +} + #if FF_API_SEEK_PUBLIC void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp) { -- 1.7.9.4