Commit 03d4063a authored by Simon Morlat's avatar Simon Morlat
Browse files

fix unitialized value in MSTicker causing framerate not being updated to encoder.

parent c63b38bb
......@@ -80,7 +80,7 @@ MSTicker *ms_ticker_new(){
MSTicker *ms_ticker_new_with_params(const MSTickerParams *params){
MSTicker *obj=(MSTicker *)ms_new(MSTicker,1);
MSTicker *obj=(MSTicker *)ms_new0(MSTicker,1);
return obj;
......@@ -172,11 +172,13 @@ static void video_stream_track_fps_changes(VideoStream *stream){
MSTickerLateEvent late_ev={0};
/*we must check that no late tick occured during the last 2 seconds, otherwise the fps measurement is severely biased.*/
if (curtime > late_ev.time + 2000){
if (stream->source && stream->ms.encoder &&
ms_filter_has_method(stream->source,MS_FILTER_GET_FPS) &&
float fps=0;
if (ms_filter_call_method(stream->source,MS_FILTER_GET_FPS,&fps)==0 && fps!=0){
if (fabsf(fps-stream->configured_fps)/stream->configured_fps>0.2){
ms_warning("Measured and target fps significantly different (%f<->%f), updating encoder.",
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment