Skip to content

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

Description

@Gillissie

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions