History

avfilter/avf_showcwt: do not return initial black frames with negative timestamps

Paul B Mahol committed 3 years ago

Commit fa4c2881 parent 09f78361 file · +6 −2Browse files

Unified · Split

libavfilter/avf_showcwt.c+6−2
@@ -672,8 +672,9 @@ static int run_channel_cwt(AVFilterContext *ctx, void *arg, int jobnr, int nb_jo · 671 unmodified lines
672 672
673 memset(isrc, 0, sizeof(*isrc) * output_padding_size);673 memset(isrc, 0, sizeof(*isrc) * output_padding_size);
674 if (offset == 0) {674 if (offset == 0) {
675 const unsigned *kindex = index + kernel_start;
675 for (int i = 0; i < kernel_range; i++) {676 for (int i = 0; i < kernel_range; i++) {
676 const unsigned n = index[i + kernel_start];677 const unsigned n = kindex[i];
677 678
678 isrc[n].re += dstx[i].re;679 isrc[n].re += dstx[i].re;
679 isrc[n].im += dstx[i].im;680 isrc[n].im += dstx[i].im;
@@ -1247,8 +1248,11 @@ static int activate(AVFilterContext *ctx) · 567 unmodified lines
1247 ff_filter_execute(ctx, run_channels_cwt_prepare, fin, NULL,1248 ff_filter_execute(ctx, run_channels_cwt_prepare, fin, NULL,
1248 FFMIN(s->nb_threads, s->nb_channels));1249 FFMIN(s->nb_threads, s->nb_channels));
1249 if (fin) {1250 if (fin) {
1250 if (s->hop_index == 0)1251 if (s->hop_index == 0) {
1251 s->in_pts = fin->pts;1252 s->in_pts = fin->pts;
1253 if (s->old_pts == AV_NOPTS_VALUE)
1254 s->old_pts = av_rescale_q(s->in_pts, inlink->time_base, outlink->time_base) - 1;
1255 }
1252 s->hop_index += fin->nb_samples;1256 s->hop_index += fin->nb_samples;
1253 av_frame_free(&fin);1257 av_frame_free(&fin);
1254 } else {1258 } else {

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