diff options
author | Michael Bradshaw <mbradshaw@sorensonmedia.com> | 2012-06-17 22:20:09 -0700 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2012-06-18 09:36:34 +0200 |
commit | 2243f0d0783922054d10497fc1d6f6fb376f05ff (patch) | |
tree | 766ee982f8492615ccaba3ecda6b8904994dbc0d /libavformat/avformat.h | |
parent | 3b3150ec9bfddd9bd57dcd378b43a8f363b0fc4f (diff) | |
download | ffmpeg-2243f0d0783922054d10497fc1d6f6fb376f05ff.tar.gz |
lavf: add field for how duration is estimated
Signed-off-by: Michael Bradshaw <mbradshaw@sorensonmedia.com>
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 19441f8e21..8650b0836a 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1099,8 +1099,25 @@ typedef struct AVFormatContext { int raw_packet_buffer_remaining_size; int avio_flags; + + /** + * The duration field can be estimated through various ways, and this field can be used + * to know how the duration was estimated. + */ + enum { + AVFMT_DURATION_FROM_PTS, ///< duration accurately estimated from PTSes + AVFMT_DURATION_FROM_STREAM, ///< duration estimated from a stream with a known duration + AVFMT_DURATION_FROM_BITRATE ///< duration estimated from bitrate (less accurate) + } duration_estimation_method; } AVFormatContext; +/** + * Returns the method used to set ctx->duration. + * + * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. + */ +int av_fmt_ctx_get_duration_estimation_method(const AVFormatContext* ctx); + typedef struct AVPacketList { AVPacket pkt; struct AVPacketList *next; |