Commit a406c082 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

macosx/framework: Make sure -[VLCExtensionManager mediaPlayer] is KVO.

parent 3f4aec54
......@@ -15,8 +15,11 @@
void *instance;
NSMutableArray *_extensions;
VLCMediaPlayer *_player;
void *_previousInput;
}
+ (VLCExtensionsManager *)sharedManager;
- (NSArray *)extensions;
- (void)runExtension:(VLCExtension *)extension;
@property (readwrite, retain) VLCMediaPlayer *mediaPlayer;
@end
......@@ -88,6 +88,12 @@ static VLCExtensionsManager *sharedManager = nil;
- (void)mediaPlayerLikelyChangedInput
{
input_thread_t *input = _player ? libvlc_media_player_get_input_thread([_player libVLCMediaPlayer]) : NULL;
// Don't send more than appropriate
if (_previousInput == input)
return;
_previousInput = input;
for(VLCExtension *extension in _extensions)
extension_SetInput(_instance, [extension instance], input);
if (input)
......@@ -110,4 +116,9 @@ static VLCExtensionsManager *sharedManager = nil;
if (player)
[center addObserver:self selector:@selector(mediaPlayerLikelyChangedInput) name:VLCMediaPlayerStateChanged object:_player];
}
- (VLCMediaPlayer *)mediaPlayer
{
return _player;
}
@end
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