[FFmpeg-cvslog] lavfi: rename link.current_pts to current_pts_us.

Nicolas George git at videolan.org
Tue Dec 22 16:11:21 CET 2015


ffmpeg | branch: master | Nicolas George <george at nsup.org> | Thu Sep 24 09:30:05 2015 +0200| [d03eab34dd8a0da63591b1fbc56149595d3907f7] | committer: Nicolas George

lavfi: rename link.current_pts to current_pts_us.

This field is used for fast comparison between link ages,
it is in AV_TIME_BASE units, in other words microseconds,
┬Ás =~ us.
Renaming it allows a second field in link time base units.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d03eab34dd8a0da63591b1fbc56149595d3907f7
---

 libavfilter/avfilter.c      |    4 ++--
 libavfilter/avfilter.h      |    2 +-
 libavfilter/avfiltergraph.c |    6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 5d7bc09..fc6d49d 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -238,7 +238,7 @@ int avfilter_config_links(AVFilterContext *filter)
         }
 
         inlink = link->src->nb_inputs ? link->src->inputs[0] : NULL;
-        link->current_pts = AV_NOPTS_VALUE;
+        link->current_pts_us = AV_NOPTS_VALUE;
 
         switch (link->init_state) {
         case AVLINK_INIT:
@@ -443,7 +443,7 @@ void ff_update_link_current_pts(AVFilterLink *link, int64_t pts)
 {
     if (pts == AV_NOPTS_VALUE)
         return;
-    link->current_pts = av_rescale_q(pts, link->time_base, AV_TIME_BASE_Q);
+    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)
         ff_avfilter_graph_update_heap(link->graph, link);
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index dca0294..dec6a91 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -437,7 +437,7 @@ struct AVFilterLink {
      * Current timestamp of the link, as defined by the most recent
      * frame(s), in AV_TIME_BASE units.
      */
-    int64_t current_pts;
+    int64_t current_pts_us;
 
     /**
      * Index in the age array.
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index d749250..ec2245f 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -1324,7 +1324,7 @@ static void heap_bubble_up(AVFilterGraph *graph,
 
     while (index) {
         int parent = (index - 1) >> 1;
-        if (links[parent]->current_pts >= link->current_pts)
+        if (links[parent]->current_pts_us >= link->current_pts_us)
             break;
         links[index] = links[parent];
         links[index]->age_index = index;
@@ -1346,9 +1346,9 @@ static void heap_bubble_down(AVFilterGraph *graph,
         if (child >= graph->sink_links_count)
             break;
         if (child + 1 < graph->sink_links_count &&
-            links[child + 1]->current_pts < links[child]->current_pts)
+            links[child + 1]->current_pts_us < links[child]->current_pts_us)
             child++;
-        if (link->current_pts < links[child]->current_pts)
+        if (link->current_pts_us < links[child]->current_pts_us)
             break;
         links[index] = links[child];
         links[index]->age_index = index;



More information about the ffmpeg-cvslog mailing list