diff options
author | Michael Bradshaw <mbradshaw@sorensonmedia.com> | 2012-06-22 17:03:18 -0600 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2012-06-28 09:59:53 +0200 |
commit | fc5999d0270ef83b9229e173b4106ae374041a19 (patch) | |
tree | 3c614ebb527ef8b7522204fc93d2d6c33f3948fa | |
parent | 87df986dcf90dcda2d10d9c3b3c84656cdd032aa (diff) | |
download | ffmpeg-fc5999d0270ef83b9229e173b4106ae374041a19.tar.gz |
lavf: add proper enum type for fmt ctx duration esitmation method
Signed-off-by: Michael Bradshaw <mbradshaw@sorensonmedia.com>
-rw-r--r-- | libavformat/avformat.h | 19 | ||||
-rw-r--r-- | libavformat/options.c | 2 |
2 files changed, 14 insertions, 7 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 143c48e17d..807c7ace7b 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -838,6 +838,17 @@ typedef struct AVChapter { AVDictionary *metadata; } AVChapter; + +/** + * The duration of a video can be estimated through various ways, and this enum can be used + * to know how the duration was estimated. + */ +enum AVDurationEstimationMethod { + 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) +}; + /** * Format I/O context. * New fields can be added to the end with minor version bumps. @@ -1108,11 +1119,7 @@ typedef struct AVFormatContext { * 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; + enum AVDurationEstimationMethod duration_estimation_method; } AVFormatContext; /** @@ -1120,7 +1127,7 @@ typedef struct AVFormatContext { * * @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); +enum AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method(const AVFormatContext* ctx); typedef struct AVPacketList { AVPacket pkt; diff --git a/libavformat/options.c b/libavformat/options.c index 915581f13f..8548381a24 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -111,7 +111,7 @@ AVFormatContext *avformat_alloc_context(void) return ic; } -int av_fmt_ctx_get_duration_estimation_method(const AVFormatContext* ctx) +enum AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method(const AVFormatContext* ctx) { return ctx->duration_estimation_method; } |