Skip to content

Allow aborting currently shown asset via SIGUSR1#92

Merged
mcbuddha merged 1 commit into
Screenly:masterfrom
SebastianSchildt:upstream
Mar 7, 2013
Merged

Allow aborting currently shown asset via SIGUSR1#92
mcbuddha merged 1 commit into
Screenly:masterfrom
SebastianSchildt:upstream

Conversation

@SebastianSchildt
Copy link
Copy Markdown
Contributor

This code allows skipping the currently displayed asset.

Why:
If you have a long running asset which you removed from the asset list (or shortened its time), but it is displayed at the moment you need to wait until the asset is finished Not good if you want to display some "Breaking news" as soon as possible.

How:
Unix signals. Normally python will terminate when receiving a signal. Added a signal handler for USR1 Signal. After processing of the signal handler, all calls to sleep() are interrupted, effectively finishing the current asset (the signal handler will also kill omxplayer, in case the current asset was a video).

This includes only the "plumbing". Eventually I plan to add a "Skip current asset" button to the WebIF, but oh my good! I understand nothing about the haml, coffe, js whatever stuff, so for the time being I failed horribly at that :)

To test, the signal could be sent like this (possibly it can be done more elegantly)

kill -s USR1 `ps a | grep [v]iewer.py | awk '{ print $1 }'`

which effectively does a "kill -s USR1 <viewer_PID>"

@mcbuddha
Copy link
Copy Markdown
Contributor

mcbuddha commented Mar 7, 2013

Yeah, it does just that, I get it now.

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

Successfully merging this pull request may close these issues.

2 participants