ue4plugins / VlcMedia

Media Framework plug-in using the Video LAN Codec (libvlc).
BSD 3-Clause "New" or "Revised" License
259 stars 143 forks source link

Wrong frame duration when playing real time stream #64

Open YouRancestor opened 5 years ago

YouRancestor commented 5 years ago

libvlc_media_player_get_fps(aka FVlc::MediaPlayerGetFps) may returns a 0.0f if the fps is unspecified in some real time streams. And the current code use its return value as denominator without check when caculating VideoFrameDuration. This can lead to an error that Engine cannot get pictures correctly from the sample pool because of the wrong duration. Just check fps and set frame duration to 1 millisecond if fps is not greater than 0.0f can resolve this problem.

nzx824 commented 4 years ago

666666,"picture is too late to be displayed" can also repair by this code!