summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2021-11-25 18:26:20 +0100
committerLynne <dev@lynne.ee>2021-12-03 22:41:00 +0100
commitb236ef0a594e20038b4045e2fecd414f1886d212 (patch)
treeb67579c48cb41c9e86e1624b0996f672ffe4ee64 /libavutil
parent03ab1de429a43a99c6de0c0d6ec1d275349dc133 (diff)
downloadffmpeg-b236ef0a594e20038b4045e2fecd414f1886d212.tar.gz
lavu/avframe: add a time_base field
This adds a time_base field to AVFrame, as an analogue to the AVPacket.time_base field.
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/frame.c2
-rw-r--r--libavutil/frame.h8
-rw-r--r--libavutil/version.h2
3 files changed, 11 insertions, 1 deletions
diff --git a/libavutil/frame.c b/libavutil/frame.c
index d4d3ad6988..64eed5b0dd 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -63,6 +63,7 @@ static void get_frame_defaults(AVFrame *frame)
frame->pkt_duration = 0;
frame->pkt_pos = -1;
frame->pkt_size = -1;
+ frame->time_base = (AVRational){ 0, 1 };
frame->key_frame = 1;
frame->sample_aspect_ratio = (AVRational){ 0, 1 };
frame->format = -1; /* unknown */
@@ -278,6 +279,7 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy)
dst->pkt_pos = src->pkt_pos;
dst->pkt_size = src->pkt_size;
dst->pkt_duration = src->pkt_duration;
+ dst->time_base = src->time_base;
dst->reordered_opaque = src->reordered_opaque;
dst->quality = src->quality;
dst->best_effort_timestamp = src->best_effort_timestamp;
diff --git a/libavutil/frame.h b/libavutil/frame.h
index 753234792e..882b5afbde 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -422,6 +422,14 @@ typedef struct AVFrame {
int64_t pkt_dts;
/**
+ * Time base for the timestamps in this frame.
+ * In the future, this field may be set on frames output by decoders or
+ * filters, but its value will be by default ignored on input to encoders
+ * or filters.
+ */
+ AVRational time_base;
+
+ /**
* picture number in bitstream order
*/
int coded_picture_number;
diff --git a/libavutil/version.h b/libavutil/version.h
index a2615cd299..017fc277a6 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 57
-#define LIBAVUTIL_VERSION_MINOR 9
+#define LIBAVUTIL_VERSION_MINOR 10
#define LIBAVUTIL_VERSION_MICRO 101
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \