History

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.

Nicolas George committed 11 years ago

Commit d03eab31 parent 63f7bee3 files · +6 −6Browse files

Unified · Split

3 files
  1. libavfilter/avfilter.c +2 −2
  2. libavfilter/avfilter.h +1 −1
  3. libavfilter/avfiltergraph.c +3 −3
libavfilter/avfilter.c+2−2
@@ -238,7 +238,7 @@ int avfilter_config_links(AVFilterContext *filter) · 237 unmodified lines
238 }238 }
239 239
240 inlink = link->src->nb_inputs ? link->src->inputs[0] : NULL;240 inlink = link->src->nb_inputs ? link->src->inputs[0] : NULL;
241 link->current_pts = AV_NOPTS_VALUE;241 link->current_pts_us = AV_NOPTS_VALUE;
242 242
243 switch (link->init_state) {243 switch (link->init_state) {
244 case AVLINK_INIT:244 case AVLINK_INIT:
@@ -443,7 +443,7 @@ void ff_update_link_current_pts(AVFilterLink *link, int64_t pts) · 198 unmodified lines
443{443{
444 if (pts == AV_NOPTS_VALUE)444 if (pts == AV_NOPTS_VALUE)
445 return;445 return;
446 link->current_pts = av_rescale_q(pts, link->time_base, AV_TIME_BASE_Q);446 link->current_pts_us = av_rescale_q(pts, link->time_base, AV_TIME_BASE_Q);
447 /* TODO use duration */447 /* TODO use duration */
448 if (link->graph && link->age_index >= 0)448 if (link->graph && link->age_index >= 0)
449 ff_avfilter_graph_update_heap(link->graph, link);449 ff_avfilter_graph_update_heap(link->graph, link);
libavfilter/avfilter.h+1−1
@@ -437,7 +437,7 @@ struct AVFilterLink { · 436 unmodified lines
437 * Current timestamp of the link, as defined by the most recent437 * Current timestamp of the link, as defined by the most recent
438 * frame(s), in AV_TIME_BASE units.438 * frame(s), in AV_TIME_BASE units.
439 */439 */
440 int64_t current_pts;440 int64_t current_pts_us;
441 441
442 /**442 /**
443 * Index in the age array.443 * Index in the age array.
libavfilter/avfiltergraph.c+3−3
@@ -1324,7 +1324,7 @@ static void heap_bubble_up(AVFilterGraph *graph, · 1323 unmodified lines
1324 1324
1325 while (index) {1325 while (index) {
1326 int parent = (index - 1) >> 1;1326 int parent = (index - 1) >> 1;
1327 if (links[parent]->current_pts >= link->current_pts)1327 if (links[parent]->current_pts_us >= link->current_pts_us)
1328 break;1328 break;
1329 links[index] = links[parent];1329 links[index] = links[parent];
1330 links[index]->age_index = index;1330 links[index]->age_index = index;
@@ -1346,9 +1346,9 @@ static void heap_bubble_down(AVFilterGraph *graph, · 15 unmodified lines
1346 if (child >= graph->sink_links_count)1346 if (child >= graph->sink_links_count)
1347 break;1347 break;
1348 if (child + 1 < graph->sink_links_count &&1348 if (child + 1 < graph->sink_links_count &&
1349 links[child + 1]->current_pts < links[child]->current_pts)1349 links[child + 1]->current_pts_us < links[child]->current_pts_us)
1350 child++;1350 child++;
1351 if (link->current_pts < links[child]->current_pts)1351 if (link->current_pts_us < links[child]->current_pts_us)
1352 break;1352 break;
1353 links[index] = links[child];1353 links[index] = links[child];
1354 links[index]->age_index = index;1354 links[index]->age_index = index;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t