diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-04-03 14:11:10 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-04-25 10:13:27 +0200 |
commit | c2cb01d418dd18e1cf997c038d37378d773121be (patch) | |
tree | 4a9a581316f6a1f9cba7de6460319224601d21f3 /libavformat/avformat.h | |
parent | fc18cc44ebfae07da153dc782572e7ce2f6fe47d (diff) | |
download | ffmpeg-c2cb01d418dd18e1cf997c038d37378d773121be.tar.gz |
lavf: introduce AVFMT_TS_NEGATIVE
Most formats do not support negative timestamps, shift them to avoid
unexpected behaviour and a number of bad crashes.
CC:libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat/avformat.h')
-rw-r--r-- | libavformat/avformat.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 067a7874b9..2512e36020 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -360,6 +360,11 @@ typedef struct AVProbeData { #define AVFMT_TS_NONSTRICT 0x20000 /**< Format does not require strictly increasing timestamps, but they must still be monotonic */ +#define AVFMT_TS_NEGATIVE 0x40000 /**< Format allows muxing negative + timestamps. If not set the timestamp + will be shifted in av_write_frame and + av_interleaved_write_frame so they + start from 0. */ /** * @addtogroup lavf_encoding @@ -1021,6 +1026,18 @@ typedef struct AVFormatContext { */ #define RAW_PACKET_BUFFER_SIZE 2500000 int raw_packet_buffer_remaining_size; + + /** + * Offset to remap timestamps to be non-negative. + * Expressed in timebase units. + */ + int64_t offset; + + /** + * Timebase for the timestamp offset. + */ + AVRational offset_timebase; + } AVFormatContext; typedef struct AVPacketList { |