History

avfilter/vf_psnr,vf_ssim: add warning if different timebases are encountered

Paul B Mahol committed 7 years ago

Commit 9e283aa1 parent 0481a1f2 files · +16 −0Browse files

Unified · Split

2 files
  1. libavfilter/vf_psnr.c +8 −0
  2. libavfilter/vf_ssim.c +8 −0
libavfilter/vf_psnr.c+8−0
@@ -350,6 +350,14 @@ static int config_output(AVFilterLink *outlink) · 349 unmodified lines
350350 if ((ret = ff_framesync_configure(&s->fs)) < 0)
351351 return ret;
352352
353+ outlink->time_base = s->fs.time_base;
354+
355+ if (av_cmp_q(mainlink->time_base, outlink->time_base) &&
356+ av_cmp_q(ctx->inputs[1]->time_base, outlink->time_base))
357+ av_log(ctx, AV_LOG_WARNING, "not matching timebases found between first input: %d/%d and second input %d/%d, results may be incorrect!\n",
358+ mainlink->time_base.num, mainlink->time_base.den,
359+ ctx->inputs[1]->time_base.num, ctx->inputs[1]->time_base.den);
360+
353361 return 0;
354362 }
355363
libavfilter/vf_ssim.c+8−0
@@ -443,6 +443,14 @@ static int config_output(AVFilterLink *outlink) · 442 unmodified lines
443443 if ((ret = ff_framesync_configure(&s->fs)) < 0)
444444 return ret;
445445
446+ outlink->time_base = s->fs.time_base;
447+
448+ if (av_cmp_q(mainlink->time_base, outlink->time_base) &&
449+ av_cmp_q(ctx->inputs[1]->time_base, outlink->time_base))
450+ av_log(ctx, AV_LOG_WARNING, "not matching timebases found between first input: %d/%d and second input %d/%d, results may be incorrect!\n",
451+ mainlink->time_base.num, mainlink->time_base.den,
452+ ctx->inputs[1]->time_base.num, ctx->inputs[1]->time_base.den);
453+
446454 return 0;
447455 }
448456

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