avdevice/v4l2: only use frame period from v4l2 if valid
There is evidence that some drivers do not set a valid value
See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=718805
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4aa4533ee8
)
Conflicts:
libavdevice/v4l2.c
This commit is contained in:
@@ -735,8 +735,11 @@ static int v4l2_set_parameters(AVFormatContext *s1)
|
|||||||
return AVERROR(errno);
|
return AVERROR(errno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s1->streams[0]->codec->time_base.den = tpf->denominator;
|
if (tpf->denominator > 0 && tpf->numerator > 0) {
|
||||||
s1->streams[0]->codec->time_base.num = tpf->numerator;
|
s1->streams[0]->codec->time_base.den = tpf->denominator;
|
||||||
|
s1->streams[0]->codec->time_base.num = tpf->numerator;
|
||||||
|
} else
|
||||||
|
av_log(s1, AV_LOG_WARNING, "Time per frame unknown\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user