Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash in exitEvent when using player argument to get info about the player that just exited #209

Open
Gillissie opened this issue Dec 13, 2020 · 0 comments

Comments

@Gillissie
Copy link

Gillissie commented Dec 13, 2020

Issue Report

Description

The exitEvent callback takes two arguments: player and exit_status. If you call something like player.get_filename(), the program crashes with an OMXPlayerDeadError.

It seems to me that the player is cleaning everything up before calling the exitEvent, making the player argument pretty useless to find out info about what just exited.

Problem reproduction

from omxplayer.player import OMXPlayer

def video_exited(player, exit_status):
    print("video exited: {}, status: {}".format(player.get_filename(), exit_status))

VIDEO_PATH = "Your Video File Here.mov"

videoPlayer = OMXPlayer(VIDEO_PATH,
                  args="--win 0,0,1024,768 --layer 1",
                  dbus_name="org.mpris.MediaPlayer2.omxplayer1")

videoPlayer.exitEvent = video_exited

# Press return to force the video to exit before it ends naturally.
input("Press Enter to continue...")

videoPlayer.quit()

Environment details

Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster

Software Version
python-omxplayer-wrapper 0.3.3
python-dbus (dpkg -s python-dbus) 1.2.8-3
python (python --version) 3.7.3
omxplayer (omxplayer --version) f543a0d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant