diff --git a/src/VideoPlayer.py b/src/VideoPlayer.py index ae0a13bf2..9dabff5fe 100644 --- a/src/VideoPlayer.py +++ b/src/VideoPlayer.py @@ -119,25 +119,29 @@ def videoDiscover(self, d, isMedia): vcodec = d.tags.get('video-codec', '[plugin did not give a name]') Log.debug('Video codec: ' + vcodec) if vcodec not in FUTUREPROOF_VIDEO_CODECS: - Log.warn('Support for %s is not guaranteed in the future; try one of: %s' % (vcodec, ', '.join(FUTUREPROOF_VIDEO_CODECS))) + self.validFile = False if d.is_audio: acodec = d.tags.get('audio-codec', '[plugin did not give a name]') Log.debug('Audio codec: ' + acodec) if acodec not in FUTUREPROOF_AUDIO_CODECS: - Log.warn('Support for %s is not guaranteed in the future; try one of: %s' % (acodec, ', '.join(FUTUREPROOF_AUDIO_CODECS))) + self.validFile = False container = d.tags.get('container-format', '[plugin did not give a name]') Log.debug('Container format: ' + container) if container not in FUTUREPROOF_CONTAINERS: - Log.warn('Support for %s is not guaranteed in the future; try one of: %s' % (container, ', '.join(FUTUREPROOF_CONTAINERS))) - - self.vidWidth, self.vidHeight = d.videowidth, d.videoheight - # Force mute if no sound track is available or - # else you'll get nothing but a black screen! - if not d.is_audio and not self.mute: - Log.warn("Video has no sound ==> forcing mute.") - self.mute = True + self.validFile = False + + if not self.validFile: + Log.warn('Refusing to play non-Ogg, non-Theora, or (if audio is present) non-Vorbis video file.') + else: + self.vidWidth, self.vidHeight = d.videowidth, d.videoheight + # Force mute if no sound track is available or + # else you'll get nothing but a black screen! + if not d.is_audio and not self.mute: + Log.warn("Video has no sound ==> forcing mute.") + self.mute = True + else: self.validFile = False