]> git.tdb.fi Git - xinema.git/commitdiff
Treat zero frame duration as zero fps rather than infinity
authorMikko Rasa <tdb@tdb.fi>
Sun, 18 Oct 2015 12:38:58 +0000 (15:38 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 18 Oct 2015 12:38:58 +0000 (15:38 +0300)
source/xinestream.cpp

index 2d2c058be2cf91f4520175570c0a28fee141b3ca..416902a3d7b835907ddc39ef0384a2a3369f7c85 100644 (file)
@@ -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);