celluloid-player / celluloid

A simple GTK+ frontend for mpv
https://celluloid-player.github.io
GNU General Public License v3.0
1.1k stars 87 forks source link

Suggestion: Celluloid should validate or just ignore conflictive/incompatible mpv scripts inside ~/.config/celluloid/scripts/. #568

Open darkshram opened 4 years ago

darkshram commented 4 years ago

Overview Description:

I copied autosub mpv script from subliminal into celulloid scripts folder (~/.config/celluloid/scripts/), but accidentally also copied mpris.so (MPRIS support for mpv) which was a symlint to /usr/lib64/mpv/mpris.so. Celluloid worked fine while playing videos, until I tried to close celluloid window. It hang and became completely non-responsive. Had to kill it from terminal. After I realized what I did, and after removing mpris.so from ~/.config/celluloid/scripts/, everything worked fine again. I think celluloid should check the contents of ~/.config/celluloid/scripts/ and validate or ignore conflictive/incompatible components. I can imagine a few scenarios exploiting this.

Steps to Reproduce:

  1. Install mpv-mpris. Copy mpris.so into ~/.config/celluloid/scripts/
  2. Open celluloid. Play anything. Should work fine until...
  3. Click on close button. Celluloid will not respond and freeze over de the desktop.

Actual Results:

Celluloid freezes over de the desktop after trying to close window with an incompatible script inside ~/.config/celluloid/scripts/.

Expected Results:

Celluloid should ignore conflictive/incompatible mpv scripts.

Version: celluloid 0.19 with mpv 0.32.0

gnome-mpv commented 4 years ago

I don't think it would be possible to do any validation. Plugins don't export any information that can be used for that.

Theoretically, all plugins should work with Celluloid, but there's something going on with CPlugins that uses GTK. For some reason, all event sources in the plugin stops firing once Celluloid calls mpv_terminate_destroy(), preventing it from handling MPV_EVENT_SHUTDOWN that's emitted afterwards. I've verified that this is the case with both mpv-mpris and the GTK CPlugin example. The simple example works without any issues.