python-omxplayer-wrapper icon indicating copy to clipboard operation
python-omxplayer-wrapper copied to clipboard

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

Open Gillissie opened this issue 5 years ago • 0 comments

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

Gillissie avatar Dec 13 '20 01:12 Gillissie