diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-02 11:57:53 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-13 16:31:15 -0400 |
commit | b631fba936d2b353f3c2a76f746bc40a1a193b75 (patch) | |
tree | 01819d1a52fe9b38a32385af0f6bca9f8b01fec9 | |
parent | 050e20aee653bf17c0e8d0317b50cfe0a7142366 (diff) | |
download | ffmpeg-streaming-b631fba936d2b353f3c2a76f746bc40a1a193b75.zip ffmpeg-streaming-b631fba936d2b353f3c2a76f746bc40a1a193b75.tar.gz |
avformat: add AVInputFormat flag AVFMT_NO_BYTE_SEEK.
This will prevent seeking by bytes for formats that cannot handle this.
-rw-r--r-- | doc/APIchanges | 3 | ||||
-rw-r--r-- | libavformat/avformat.h | 3 | ||||
-rw-r--r-- | libavformat/utils.c | 2 | ||||
-rw-r--r-- | libavformat/version.h | 2 |
4 files changed, 8 insertions, 2 deletions
diff --git a/doc/APIchanges b/doc/APIchanges index e48173c..c4557f0 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,9 @@ libavutil: 2011-04-18 API changes, most recent first: +2011-xx-xx - xxxxxxx - lavf 53.9.0 + Add AVFMT_NO_BYTE_SEEK AVInputFormat flag. + 2011-10-12 - lavu 51.12.0 AVOptions API rewrite. diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 7b350f1..70d466e 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -274,6 +274,7 @@ typedef struct AVFormatParameters { #define AVFMT_NOSTREAMS 0x1000 /**< Format does not require any streams */ #define AVFMT_NOBINSEARCH 0x2000 /**< Format does not allow to fallback to binary search via read_timestamp */ #define AVFMT_NOGENSEARCH 0x4000 /**< Format does not allow to fallback to generic search */ +#define AVFMT_NO_BYTE_SEEK 0x8000 /**< Format does not allow seeking by bytes */ typedef struct AVOutputFormat { const char *name; @@ -408,7 +409,7 @@ typedef struct AVInputFormat { /** * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH, - * AVFMT_NOGENSEARCH. + * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK. */ int flags; diff --git a/libavformat/utils.c b/libavformat/utils.c index fc17f18..3115723 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1750,6 +1750,8 @@ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int f AVStream *st; if (flags & AVSEEK_FLAG_BYTE) { + if (s->iformat->flags & AVFMT_NO_BYTE_SEEK) + return -1; ff_read_frame_flush(s); return seek_frame_byte(s, stream_index, timestamp, flags); } diff --git a/libavformat/version.h b/libavformat/version.h index 82a07db..53c585a 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -24,7 +24,7 @@ #include "libavutil/avutil.h" #define LIBAVFORMAT_VERSION_MAJOR 53 -#define LIBAVFORMAT_VERSION_MINOR 8 +#define LIBAVFORMAT_VERSION_MINOR 9 #define LIBAVFORMAT_VERSION_MICRO 0 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ |