Browse Source

lavu/timecode: clarify error msg for timecode_rate

The user-supplied value for timecode_rate in drawtext is rounded
to nearest integer. So, a supplied value of 0.49 or lower is rounded to 0.
This throws a misleading error message which says "Timecode frame rate must be
specified". Changed message to account for values under one.

Also noted supported framerates for drop TC.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.0
Gyan Doshi Michael Niedermayer 8 years ago
parent
commit
84556ef059
2 changed files with 4 additions and 2 deletions
  1. +3
    -1
      doc/filters.texi
  2. +1
    -1
      libavutil/timecode.c

+ 3
- 1
doc/filters.texi View File

@@ -7365,7 +7365,9 @@ format. It can be used with or without text parameter. @var{timecode_rate}
option must be specified.

@item timecode_rate, rate, r
Set the timecode frame rate (timecode only).
Set the timecode frame rate (timecode only). Value will be rounded to nearest
integer. Minimum value is "1".
Drop-frame timecode is supported for frame rates 30 & 60.

@item tc24hmax
If set to 1, the output of the timecode option will wrap around at 24 hours.


+ 1
- 1
libavutil/timecode.c View File

@@ -155,7 +155,7 @@ static int check_fps(int fps)
static int check_timecode(void *log_ctx, AVTimecode *tc)
{
if ((int)tc->fps <= 0) {
av_log(log_ctx, AV_LOG_ERROR, "Timecode frame rate must be specified\n");
av_log(log_ctx, AV_LOG_ERROR, "Valid timecode frame rate must be specified. Minimum value is 1\n");
return AVERROR(EINVAL);
}
if ((tc->flags & AV_TIMECODE_FLAG_DROPFRAME) && tc->fps != 30 && tc->fps != 60) {


Loading…
Cancel
Save