added a fix for crashes at the end of video playback due to an invalid arithmetic operation which would take place inside the media player