From: Mikko Rasa Date: Sun, 18 Oct 2015 12:38:58 +0000 (+0300) Subject: Treat zero frame duration as zero fps rather than infinity X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=9050978f3b1c47e5dd64380637eb3a430bbe7a4c;p=xinema.git Treat zero frame duration as zero fps rather than infinity --- diff --git a/source/xinestream.cpp b/source/xinestream.cpp index 2d2c058..416902a 100644 --- a/source/xinestream.cpp +++ b/source/xinestream.cpp @@ -150,7 +150,8 @@ void XineStream::update_info() signal_video_size_changed.emit(video_width, video_height); } - float fps = 90000.0f/xine_get_stream_info(stream, XINE_STREAM_INFO_FRAME_DURATION); + unsigned frame_dur = xine_get_stream_info(stream, XINE_STREAM_INFO_FRAME_DURATION); + float fps = (frame_dur ? 90000.0f/frame_dur : 0.0f); if(fps!=framerate) { MutexLock lock(mutex);