Commit ec989599 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Media List Player: prevent deadlocks when blocking or waiting on the main thread

parent dbbf6634
......@@ -115,21 +115,37 @@
- (void)playMedia:(VLCMedia *)media
{
if ([NSThread isMainThread]) {
[self performSelectorInBackground:@selector(playMedia:) withObject:media];
return;
}
libvlc_media_list_player_play_item(instance, [media libVLCMediaDescriptor]);
}
- (void)play
{
if ([NSThread isMainThread]) {
[self performSelectorInBackground:@selector(play) withObject:nil];
return;
}
libvlc_media_list_player_play(instance);
}
- (void)pause
{
if ([NSThread isMainThread]) {
[self performSelectorInBackground:@selector(pause) withObject:nil];
return;
}
libvlc_media_list_player_pause(instance);
}
- (void)stop
{
if ([NSThread isMainThread]) {
[self performSelectorInBackground:@selector(stop) withObject:nil];
return;
}
libvlc_media_list_player_stop(instance);
}
......
......@@ -1091,7 +1091,6 @@ static void HandleMediaPlayerSnapshot(const libvlc_event_t * event, void * self)
- (void)gotoNextFrame
{
libvlc_media_player_next_frame(_playerInstance);
}
- (void)fastForward
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment