Skip to content

Commit

Permalink
Refuse to play non-Theora video while we're still using gstreamer.
Browse files Browse the repository at this point in the history
  • Loading branch information
stump committed Nov 21, 2010
1 parent e9c8b98 commit 91686d8
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/VideoPlayer.py
Expand Up @@ -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

Expand Down

0 comments on commit 91686d8

Please sign in to comment.