qt: do not take snapshots from the UI thread
Snapshots are performed via a call to:
var_TriggerCallback("video-snapshot")
causing its callback (SnapshotCallback) to be called synchronously, executing the following steps:
- wait for the vout thread to actually capture the (next) frame;
- encode the picture to PNG;
- write the result to disk (I/O).
Since var_TriggerCallback("video-snapshot")
is called from the UI
thread, all these blocking actions are also performed on the UI thread.
Move the call to a separate thread.
Edited by Romain Vimont