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

Showing the changes to libavfilter (2 of 2 files). Show all

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
350 if ((ret = ff_framesync_configure(&s->fs)) < 0)350 if ((ret = ff_framesync_configure(&s->fs)) < 0)
351 return ret;351 return ret;
352 352
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
353 return 0;361 return 0;
354}362}
355 363
libavfilter/vf_ssim.c+8−0
@@ -443,6 +443,14 @@ static int config_output(AVFilterLink *outlink) · 442 unmodified lines
443 if ((ret = ff_framesync_configure(&s->fs)) < 0)443 if ((ret = ff_framesync_configure(&s->fs)) < 0)
444 return ret;444 return ret;
445 445
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
446 return 0;454 return 0;
447}455}
448 456

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