History

avfilter/avfilter: add sample_count_in and sample_count_out

Paul B Mahol committed 6 years ago

Commit c3178621 parent 82123e12 files · +7 −0Browse files

Unified · Split

2 files
  1. libavfilter/avfilter.c +2 −0
  2. libavfilter/avfilter.h +5 −0
libavfilter/avfilter.c+2−0
@@ -1013,6 +1013,7 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame) · 1012 unmodified lines
10131013
10141014 link->frame_blocked_in = link->frame_wanted_out = 0;
10151015 link->frame_count_in++;
1016+ link->sample_count_in += frame->nb_samples;
10161017 filter_unblock(link->dst);
10171018 ret = ff_framequeue_add(&link->fifo, frame);
10181019 if (ret < 0) {
@@ -1372,6 +1373,7 @@ static void consume_update(AVFilterLink *link, const AVFrame *frame) · 353 unmodified lines
13721373 ff_inlink_process_commands(link, frame);
13731374 link->dst->is_disabled = !ff_inlink_evaluate_timeline_at_frame(link, frame);
13741375 link->frame_count_out++;
1376+ link->sample_count_out += frame->nb_samples;
13751377 }
13761378
13771379 int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe)
libavfilter/avfilter.h+5−0
@@ -584,6 +584,11 @@ struct AVFilterLink { · 583 unmodified lines
584584 */
585585 int64_t frame_count_in, frame_count_out;
586586
587+ /**
588+ * Number of past samples sent through the link.
589+ */
590+ int64_t sample_count_in, sample_count_out;
591+
587592 /**
588593 * A pointer to a FFFramePool struct.
589594 */

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