History

avfilter/f_reverse: readjust frame timestamps for areverse

Paul B Mahol committed 5 years ago

Commit 45dc6681 parent 0370c3e1 file · +3 −1Browse files

Unified · Split

libavfilter/f_reverse.c+3−1
@@ -33,6 +33,7 @@ typedef struct ReverseContext { · 32 unmodified lines
33 unsigned int pts_size;33 unsigned int pts_size;
34 int64_t *pts;34 int64_t *pts;
35 int flush_idx;35 int flush_idx;
36 int64_t nb_samples;
36} ReverseContext;37} ReverseContext;
37 38
38static av_cold int init(AVFilterContext *ctx)39static av_cold int init(AVFilterContext *ctx)
@@ -249,7 +250,8 @@ static int areverse_request_frame(AVFilterLink *outlink) · 210 unmodified lines
249 250
250 if (ret == AVERROR_EOF && s->nb_frames > 0) {251 if (ret == AVERROR_EOF && s->nb_frames > 0) {
251 AVFrame *out = s->frames[s->nb_frames - 1];252 AVFrame *out = s->frames[s->nb_frames - 1];
252 out->pts = s->pts[s->flush_idx++];253 out->pts = s->pts[s->flush_idx++] - s->nb_samples;
254 s->nb_samples += s->pts[s->flush_idx] - s->pts[s->flush_idx - 1] - out->nb_samples;
253 255
254 if (av_sample_fmt_is_planar(out->format))256 if (av_sample_fmt_is_planar(out->format))
255 reverse_samples_planar(out);257 reverse_samples_planar(out);

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