[FFmpeg-devel] [PATCH 2/5] lavfi: add link.current_pts field.
Nicolas George
george at nsup.org
Sun Nov 29 17:21:49 CET 2015
Signed-off-by: Nicolas George <george at nsup.org>
---
libavfilter/avfilter.c | 2 ++
libavfilter/avfilter.h | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index e583ec0..06a8239 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -237,6 +237,7 @@ int avfilter_config_links(AVFilterContext *filter)
}
inlink = link->src->nb_inputs ? link->src->inputs[0] : NULL;
+ link->current_pts =
link->current_pts_us = AV_NOPTS_VALUE;
switch (link->init_state) {
@@ -442,6 +443,7 @@ void ff_update_link_current_pts(AVFilterLink *link, int64_t pts)
{
if (pts == AV_NOPTS_VALUE)
return;
+ link->current_pts = pts;
link->current_pts_us = av_rescale_q(pts, link->time_base, AV_TIME_BASE_Q);
/* TODO use duration */
if (link->graph && link->age_index >= 0)
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index b756f56..a6aa919 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -435,6 +435,12 @@ struct AVFilterLink {
/**
* Current timestamp of the link, as defined by the most recent
+ * frame(s), in link time_base units.
+ */
+ int64_t current_pts;
+
+ /**
+ * Current timestamp of the link, as defined by the most recent
* frame(s), in AV_TIME_BASE units.
*/
int64_t current_pts_us;
--
2.6.2
More information about the ffmpeg-devel
mailing list