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");
|
"The driver does not allow to change time per frame\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (tpf->denominator > 0 && tpf->numerator > 0) {
|
||||||
s1->streams[0]->avg_frame_rate.num = tpf->denominator;
|
s1->streams[0]->avg_frame_rate.num = tpf->denominator;
|
||||||
s1->streams[0]->avg_frame_rate.den = tpf->numerator;
|
s1->streams[0]->avg_frame_rate.den = tpf->numerator;
|
||||||
s1->streams[0]->r_frame_rate = s1->streams[0]->avg_frame_rate;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user