diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-04-04 04:01:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-04-04 04:04:24 +0200 |
commit | e10f5bd05cec8fe59bb43fd28c4c2a092ca5f440 (patch) | |
tree | 9842f500f02a60396c51bf34fdd0f6203e47da24 /libavformat | |
parent | 1c0d8f2563cc2a5b3ce78056572a7ee40b0f5987 (diff) | |
download | ffmpeg-e10f5bd05cec8fe59bb43fd28c4c2a092ca5f440.tar.gz |
avformat: Add a mechanism to allow demuxers to detect byte based seeking.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/avformat.h | 8 | ||||
-rw-r--r-- | libavformat/utils.c | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 57603031a4..80d693a113 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1257,6 +1257,14 @@ typedef struct AVFormatContext { */ #define RAW_PACKET_BUFFER_SIZE 2500000 int raw_packet_buffer_remaining_size; + + /** + * IO repositioned flag. + * This is set by avformat when the underlaying IO context read pointer + * is repositioned, for example when doing byte based seeking. + * Demuxers can use the flag to detect such changes. + */ + int io_repositioned; } AVFormatContext; /** diff --git a/libavformat/utils.c b/libavformat/utils.c index 001b0e3179..c5d6d322c3 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2018,6 +2018,8 @@ static int seek_frame_byte(AVFormatContext *s, int stream_index, int64_t pos, in avio_seek(s->pb, pos, SEEK_SET); + s->io_repositioned = 1; + return 0; } |