Skip to content

Commit

Permalink
Add display autodetection
Browse files Browse the repository at this point in the history
progresses #62
  • Loading branch information
eclispe committed Nov 30, 2021
1 parent eb91db9 commit 85554a5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rydeplayer/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,12 @@ def loadFile(self, path):
class player(object):

def __init__(self, configFile = None):
# Autodetect output display
if(len(pydispmanx.getDisplays())<1):
raise RuntimeError('No displays detected')
else:
self.displayId = pydispmanx.getDisplays()[0]

# setup ui core
pygame.init()
self.theme = Theme(pydispmanx.getDisplaySize())
Expand Down Expand Up @@ -778,6 +782,9 @@ def vlcStartup(self):
vlcArgs += '--width '+str(displaySize[0])+' --height '+str(displaySize[1])+' '
displayPAR = pydispmanx.getPixelAspectRatio()
vlcArgs += '--monitor-par '+str(displayPAR[0])+':'+str(displayPAR[1])+' '
# vlc needs manually telling if using the second HDMI
if self.displayId == 7:
vlcArgs += '--mmal-display hdmi-2 '
if self.config.debug.disableHardwareCodec:
vlcArgs += '--codec ffmpeg '
# vlcArgs += '--gain 4 --alsa-audio-device hw:CARD=Headphones,DEV=0 '
Expand Down

0 comments on commit 85554a5

Please sign in to comment.