Skip to content

Commit

Permalink
Fixed issues where windowed mode wouldn't work the first time playing…
Browse files Browse the repository at this point in the history
… a video
  • Loading branch information
heniotierra committed Oct 25, 2020
1 parent 73d53b8 commit 3f17234
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions tboplayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,19 +636,21 @@ def start_omx(self, track, skip_ytdl_check=False):
" --vol " + str(self.get_mB()) + " " + self.options.omx_subtitles + " " +
(" --subtitles " + self.ytdl._YTLAUNCH_SUB_DIR + "/subtitle." + self.options.subtitles_lang + ".srt" if self.ytdl.subtitle_ready_signal else ""))

if self.media_is_video():
if not self.options.forbid_windowed_mode and not self.options.full_screen and '--win' not in opts:
mc = self.RE_COORDS.match(self.options.windowed_mode_coords)
mg = self.RE_RESOLUTION.match(self.options.windowed_mode_resolution)
if mc and mg:
w, h, x, y = [int(v) for v in mg.groups()+mc.groups()]
opts += ' --win %d,%d,%d,%d' % (x, y, x+w, y+h)

if not '--aspect-mode' in opts:
opts += ' --aspect-mode letterbox'

if not '--no-osd' in opts:
opts += ' --no-osd'
#print(639, "self.media_is_video()",self.media_is_video())
#print(hasattr(self,"omx"), hasattr(self.omx, "video"), len(self.omx.video) > 0)
#if self.media_is_video():
if not self.options.forbid_windowed_mode and not self.options.full_screen and '--win' not in opts:
mc = self.RE_COORDS.match(self.options.windowed_mode_coords)
mg = self.RE_RESOLUTION.match(self.options.windowed_mode_resolution)
if mc and mg:
w, h, x, y = [int(v) for v in mg.groups()+mc.groups()]
opts += ' --win %d,%d,%d,%d' % (x, y, x+w, y+h)

if not '--aspect-mode' in opts:
opts += ' --aspect-mode letterbox'

if not '--no-osd' in opts:
opts += ' --no-osd'

self.monitor('starting omxplayer with args: "%s"' % (opts,))

Expand Down Expand Up @@ -2269,7 +2271,7 @@ def nope(self):
# ***************************************

if __name__ == "__main__":
datestring="5 Feb 2019"
datestring="25 Oct 2020"

dbusif_tboplayer = None
try:
Expand Down

0 comments on commit 3f17234

Please sign in to comment.