mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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>
This commit is contained in:
parent
392b0345d6
commit
4aa4533ee8
@ -742,9 +742,12 @@ static int v4l2_set_parameters(AVFormatContext *s1)
|
||||
"The driver does not allow to change time per frame\n");
|
||||
}
|
||||
}
|
||||
s1->streams[0]->avg_frame_rate.num = tpf->denominator;
|
||||
s1->streams[0]->avg_frame_rate.den = tpf->numerator;
|
||||
s1->streams[0]->r_frame_rate = s1->streams[0]->avg_frame_rate;
|
||||
if (tpf->denominator > 0 && tpf->numerator > 0) {
|
||||
s1->streams[0]->avg_frame_rate.num = tpf->denominator;
|
||||
s1->streams[0]->avg_frame_rate.den = tpf->numerator;
|
||||
s1->streams[0]->r_frame_rate = s1->streams[0]->avg_frame_rate;
|
||||
} else
|
||||
av_log(s1, AV_LOG_WARNING, "Time per frame unknown\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user