mirror of https://git.ffmpeg.org/ffmpeg.git
avfilter/avf_showcwt: do not return initial black frames with negative timestamps
This commit is contained in:
parent
09f783692e
commit
fa4c2884dd
|
@ -672,8 +672,9 @@ static int run_channel_cwt(AVFilterContext *ctx, void *arg, int jobnr, int nb_jo
|
||||||
|
|
||||||
memset(isrc, 0, sizeof(*isrc) * output_padding_size);
|
memset(isrc, 0, sizeof(*isrc) * output_padding_size);
|
||||||
if (offset == 0) {
|
if (offset == 0) {
|
||||||
|
const unsigned *kindex = index + kernel_start;
|
||||||
for (int i = 0; i < kernel_range; i++) {
|
for (int i = 0; i < kernel_range; i++) {
|
||||||
const unsigned n = index[i + kernel_start];
|
const unsigned n = kindex[i];
|
||||||
|
|
||||||
isrc[n].re += dstx[i].re;
|
isrc[n].re += dstx[i].re;
|
||||||
isrc[n].im += dstx[i].im;
|
isrc[n].im += dstx[i].im;
|
||||||
|
@ -1247,8 +1248,11 @@ static int activate(AVFilterContext *ctx)
|
||||||
ff_filter_execute(ctx, run_channels_cwt_prepare, fin, NULL,
|
ff_filter_execute(ctx, run_channels_cwt_prepare, fin, NULL,
|
||||||
FFMIN(s->nb_threads, s->nb_channels));
|
FFMIN(s->nb_threads, s->nb_channels));
|
||||||
if (fin) {
|
if (fin) {
|
||||||
if (s->hop_index == 0)
|
if (s->hop_index == 0) {
|
||||||
s->in_pts = fin->pts;
|
s->in_pts = fin->pts;
|
||||||
|
if (s->old_pts == AV_NOPTS_VALUE)
|
||||||
|
s->old_pts = av_rescale_q(s->in_pts, inlink->time_base, outlink->time_base) - 1;
|
||||||
|
}
|
||||||
s->hop_index += fin->nb_samples;
|
s->hop_index += fin->nb_samples;
|
||||||
av_frame_free(&fin);
|
av_frame_free(&fin);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue