mirror of
https://code.videolan.org/videolan/vlc
synced 2024-08-18 23:45:06 +02:00
Revert "macosx: clean access to the aout/vout threads"
This commit immediately crashes VLC at startup.
This reverts commit 224b04306d
.
This commit is contained in:
parent
0caa73ce69
commit
b39f7e4633
@ -61,7 +61,6 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
|
||||
|
||||
VLCClickerManager *_clickerManager;
|
||||
VLCPlaylistController *_playlistController;
|
||||
VLCPlayerController *_playerController;
|
||||
}
|
||||
@end
|
||||
|
||||
@ -95,7 +94,6 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
|
||||
|
||||
_clickerManager = [[VLCClickerManager alloc] init];
|
||||
_playlistController = [[VLCMain sharedInstance] playlistController];
|
||||
_playerController = [_playlistController playerController];
|
||||
|
||||
var_AddCallback(pl_Get(p_intf), "intf-boss", BossCallback, (__bridge void *)self);
|
||||
}
|
||||
@ -121,16 +119,18 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
|
||||
|
||||
- (void)playOrPause
|
||||
{
|
||||
input_item_t *p_input_item = _playlistController.currentlyPlayingInputItem;
|
||||
VLCMain *mainInstance = [VLCMain sharedInstance];
|
||||
VLCPlaylistController *playlistController = mainInstance.playlistController;
|
||||
input_item_t *p_input_item = playlistController.currentlyPlayingInputItem;
|
||||
|
||||
if (p_input_item) {
|
||||
[_playerController togglePlayPause];
|
||||
[playlistController.playerController togglePlayPause];
|
||||
input_item_Release(p_input_item);
|
||||
} else {
|
||||
if (_playlistController.playlistModel.numberOfPlaylistItems == 0)
|
||||
[[[VLCMain sharedInstance] open] openFileGeneric];
|
||||
if (mainInstance.playlistController.playlistModel.numberOfPlaylistItems == 0)
|
||||
[[mainInstance open] openFileGeneric];
|
||||
else
|
||||
[_playlistController startPlaylist];
|
||||
[playlistController startPlaylist];
|
||||
}
|
||||
}
|
||||
|
||||
@ -381,7 +381,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
|
||||
}
|
||||
config_PutInt("random", on);
|
||||
|
||||
vout_thread_t *p_vout = [_playerController mainVideoOutputThread];
|
||||
vout_thread_t *p_vout = [[_playlistController playerController] mainVideoOutputThread];
|
||||
if (!p_vout) {
|
||||
return;
|
||||
}
|
||||
@ -398,7 +398,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
|
||||
{
|
||||
_playlistController.playbackRepeat = VLC_PLAYLIST_PLAYBACK_REPEAT_ALL;
|
||||
|
||||
vout_thread_t *p_vout = [_playerController mainVideoOutputThread];
|
||||
vout_thread_t *p_vout = [[_playlistController playerController] mainVideoOutputThread];
|
||||
if (p_vout) {
|
||||
vout_OSDMessage(p_vout, VOUT_SPU_CHANNEL_OSD, "%s", _("Repeat All"));
|
||||
vout_Release(p_vout);
|
||||
@ -409,7 +409,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
|
||||
{
|
||||
_playlistController.playbackRepeat = VLC_PLAYLIST_PLAYBACK_REPEAT_CURRENT;
|
||||
|
||||
vout_thread_t *p_vout = [_playerController mainVideoOutputThread];
|
||||
vout_thread_t *p_vout = [[_playlistController playerController] mainVideoOutputThread];
|
||||
if (p_vout) {
|
||||
vout_OSDMessage(p_vout, VOUT_SPU_CHANNEL_OSD, "%s", _("Repeat One"));
|
||||
vout_Release(p_vout);
|
||||
@ -420,7 +420,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
|
||||
{
|
||||
_playlistController.playbackRepeat = VLC_PLAYLIST_PLAYBACK_REPEAT_NONE;
|
||||
|
||||
vout_thread_t *p_vout = [_playerController mainVideoOutputThread];
|
||||
vout_thread_t *p_vout = [[_playlistController playerController] mainVideoOutputThread];
|
||||
if (p_vout) {
|
||||
vout_OSDMessage(p_vout, VOUT_SPU_CHANNEL_OSD, "%s", _("Repeat Off"));
|
||||
vout_Release(p_vout);
|
||||
@ -574,7 +574,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
|
||||
|
||||
- (void)showPosition
|
||||
{
|
||||
vout_thread_t *p_vout = [_playerController mainVideoOutputThread];
|
||||
vout_thread_t *p_vout = [[_playlistController playerController] mainVideoOutputThread];
|
||||
if (p_vout != NULL) {
|
||||
var_SetInteger(vlc_object_instance(getIntf()), "key-action", ACTIONID_POSITION);
|
||||
vout_Release(p_vout);
|
||||
@ -678,7 +678,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
|
||||
unichar key = [characters characterAtIndex: 0];
|
||||
|
||||
if (key) {
|
||||
vout_thread_t *p_vout = [_playerController mainVideoOutputThread];
|
||||
vout_thread_t *p_vout = [[_playlistController playerController] mainVideoOutputThread];
|
||||
if (p_vout != NULL) {
|
||||
/* Escape */
|
||||
if (key == (unichar) 0x1b) {
|
||||
|
@ -585,7 +585,7 @@
|
||||
[self setupVarMenuItem:_subtitle_track target: (vlc_object_t *)p_input
|
||||
var:"spu-es" selector: @selector(toggleVar:)];
|
||||
|
||||
audio_output_t *p_aout = [_playerController mainAudioOutput];
|
||||
audio_output_t *p_aout = _playlistController.playerController.mainAudioOutput;
|
||||
if (p_aout != NULL) {
|
||||
[self setupVarMenuItem:_channels target: (vlc_object_t *)p_aout
|
||||
var:"stereo-mode" selector: @selector(toggleVar:)];
|
||||
@ -595,7 +595,7 @@
|
||||
aout_Release(p_aout);
|
||||
}
|
||||
|
||||
vout_thread_t *p_vout = [_playerController videoOutputThreadForKeyWindow];
|
||||
vout_thread_t *p_vout = [[[[VLCMain sharedInstance] playlistController] playerController] videoOutputThreadForKeyWindow];
|
||||
|
||||
if (p_vout != NULL) {
|
||||
[self setupVarMenuItem:_aspect_ratio target: (vlc_object_t *)p_vout
|
||||
@ -886,7 +886,7 @@
|
||||
|
||||
[_audioDeviceMenu removeAllItems];
|
||||
|
||||
audio_output_t *p_aout = [_playerController mainAudioOutput];
|
||||
audio_output_t *p_aout = _playlistController.playerController.mainAudioOutput;
|
||||
if (!p_aout)
|
||||
return;
|
||||
|
||||
@ -923,7 +923,7 @@
|
||||
|
||||
- (void)toggleAudioDevice:(id)sender
|
||||
{
|
||||
audio_output_t *p_aout = [_playerController mainAudioOutput];
|
||||
audio_output_t *p_aout = _playlistController.playerController.mainAudioOutput;
|
||||
if (!p_aout)
|
||||
return;
|
||||
|
||||
@ -950,7 +950,7 @@
|
||||
|
||||
- (IBAction)resizeVideoWindow:(id)sender
|
||||
{
|
||||
vout_thread_t *p_vout = [_playerController videoOutputThreadForKeyWindow];
|
||||
vout_thread_t *p_vout = [[[[VLCMain sharedInstance] playlistController] playerController] videoOutputThreadForKeyWindow];
|
||||
if (p_vout) {
|
||||
if (sender == _half_window)
|
||||
var_SetFloat(p_vout, "zoom", 0.5);
|
||||
@ -971,7 +971,7 @@
|
||||
// FIXME re-write using VLCPlayerController
|
||||
input_thread_t *p_input = pl_CurrentInput(getIntf());
|
||||
if (p_input) {
|
||||
vout_thread_t *p_vout = [_playerController videoOutputThreadForKeyWindow];
|
||||
vout_thread_t *p_vout = [[[[VLCMain sharedInstance] playlistController] playerController] videoOutputThreadForKeyWindow];
|
||||
if (p_vout) {
|
||||
BOOL b_fs = var_ToggleBool(p_vout, "video-on-top");
|
||||
var_SetBool(pl_Get(getIntf()), "video-on-top", b_fs);
|
||||
@ -1659,7 +1659,7 @@
|
||||
mi == _floatontop
|
||||
) {
|
||||
|
||||
vout_thread_t *p_vout = [_playerController videoOutputThreadForKeyWindow];
|
||||
vout_thread_t *p_vout = [[[[VLCMain sharedInstance] playlistController] playerController] videoOutputThreadForKeyWindow];
|
||||
if (p_vout != NULL) {
|
||||
// FIXME: re-write using VLCPlayerController
|
||||
if (mi == _floatontop)
|
||||
|
@ -41,11 +41,6 @@
|
||||
#import "playlist/VLCPlaylistController.h"
|
||||
#import "playlist/VLCPlayerController.h"
|
||||
|
||||
@interface VLCAudioEffectsWindowController ()
|
||||
{
|
||||
VLCPlayerController *_playerController;
|
||||
}
|
||||
@end
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Initialization
|
||||
@ -101,8 +96,6 @@
|
||||
{
|
||||
self = [super initWithWindowNibName:@"AudioEffects"];
|
||||
if (self) {
|
||||
_playerController = [[[VLCMain sharedInstance] playlistController] playerController];
|
||||
|
||||
self.popupPanel = [[VLCPopupPanelController alloc] init];
|
||||
self.textfieldPanel = [[VLCTextfieldPanelController alloc] init];
|
||||
|
||||
@ -160,7 +153,7 @@
|
||||
|
||||
/* eq preset */
|
||||
char const *psz_eq_preset = [B64DecNSStr([items firstObject]) UTF8String];
|
||||
audio_output_t *p_aout = [_playerController mainAudioOutput];
|
||||
audio_output_t *p_aout = [[[[VLCMain sharedInstance] playlistController] playerController] mainAudioOutput];
|
||||
if (p_aout)
|
||||
var_SetString(p_aout, "equalizer-preset", psz_eq_preset);
|
||||
var_SetString(p_playlist, "equalizer-preset", psz_eq_preset);
|
||||
@ -616,11 +609,10 @@
|
||||
#pragma mark -
|
||||
#pragma mark Equalizer
|
||||
static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
|
||||
VLCPlayerController *playerController,
|
||||
char *psz_name)
|
||||
{
|
||||
char *psz_parser, *psz_string = NULL;
|
||||
audio_output_t *p_aout = [playerController mainAudioOutput];
|
||||
audio_output_t *p_aout = [[[[VLCMain sharedInstance] playlistController] playerController] mainAudioOutput];
|
||||
if (!p_aout)
|
||||
return false;
|
||||
|
||||
@ -662,7 +654,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
|
||||
[[_equalizerPresetsPopup lastItem] setAction: @selector(deletePresetAction:)];
|
||||
}
|
||||
|
||||
audio_output_t *p_aout = [_playerController mainAudioOutput];
|
||||
audio_output_t *p_aout = [[[[VLCMain sharedInstance] playlistController] playerController] mainAudioOutput];
|
||||
|
||||
NSString *currentPreset = nil;
|
||||
if (p_aout) {
|
||||
@ -692,7 +684,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
|
||||
intf_thread_t *p_intf = getIntf();
|
||||
playlist_t *p_playlist = pl_Get(p_intf);
|
||||
bool b_2p = var_CreateGetBool(p_playlist, "equalizer-2pass");
|
||||
bool bEnabled = GetEqualizerStatus(p_intf, _playerController, (char *)"equalizer");
|
||||
bool bEnabled = GetEqualizerStatus(p_intf, (char *)"equalizer");
|
||||
|
||||
/* Setup sliders */
|
||||
var_Create(p_playlist, "equalizer-preset",
|
||||
@ -766,7 +758,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
|
||||
|
||||
- (IBAction)equalizerBandSliderUpdated:(id)sender
|
||||
{
|
||||
audio_output_t *p_aout = [_playerController mainAudioOutput];
|
||||
audio_output_t *p_aout = [[[[VLCMain sharedInstance] playlistController] playerController] mainAudioOutput];
|
||||
char const *psz_preset_values = [[self generatePresetString] UTF8String];
|
||||
if (p_aout) {
|
||||
var_SetString(p_aout, "equalizer-bands", psz_preset_values);
|
||||
@ -784,7 +776,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
|
||||
float f_eq_preamp = [[[defaults objectForKey:@"EQPreampValues"] objectAtIndex:numberOfChosenPreset] floatValue];
|
||||
char const *psz_eq_preset = [[[defaults objectForKey:@"EQNames"] objectAtIndex:numberOfChosenPreset] UTF8String];
|
||||
|
||||
audio_output_t *p_aout = [_playerController mainAudioOutput];
|
||||
audio_output_t *p_aout = [[[[VLCMain sharedInstance] playlistController] playerController] mainAudioOutput];
|
||||
if (p_aout) {
|
||||
var_SetString(p_aout, "equalizer-bands", psz_eq_bands);
|
||||
var_SetFloat(p_aout, "equalizer-preamp", f_eq_preamp);
|
||||
@ -804,7 +796,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
|
||||
{
|
||||
float fPreamp = [sender floatValue] ;
|
||||
|
||||
audio_output_t *p_aout = [_playerController mainAudioOutput];
|
||||
audio_output_t *p_aout = [[[[VLCMain sharedInstance] playlistController] playerController] mainAudioOutput];
|
||||
if (p_aout) {
|
||||
var_SetFloat(p_aout, "equalizer-preamp", fPreamp);
|
||||
aout_Release(p_aout);
|
||||
@ -816,7 +808,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
|
||||
{
|
||||
bool b_2p = [sender state] ? true : false;
|
||||
|
||||
audio_output_t *p_aout = [_playerController mainAudioOutput];
|
||||
audio_output_t *p_aout = [[[[VLCMain sharedInstance] playlistController] playerController] mainAudioOutput];
|
||||
if (p_aout) {
|
||||
var_SetBool(p_aout, "equalizer-2pass", b_2p);
|
||||
aout_Release(p_aout);
|
||||
@ -858,7 +850,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
|
||||
|
||||
/* update VLC internals */
|
||||
char const *psz_eq_preset = [decomposedStringWithCanonicalMapping UTF8String];
|
||||
audio_output_t *p_aout = [self->_playerController mainAudioOutput];
|
||||
audio_output_t *p_aout = [[[[VLCMain sharedInstance] playlistController] playerController] mainAudioOutput];
|
||||
if (p_aout) {
|
||||
var_SetString(p_aout, "equalizer-preset", psz_eq_preset);
|
||||
aout_Release(p_aout);
|
||||
@ -951,7 +943,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
|
||||
var_SetFloat(p_playlist, "compressor-knee", 2.500000);
|
||||
var_SetFloat(p_playlist, "compressor-makeup-gain", 7.000000);
|
||||
|
||||
audio_output_t *p_aout = [_playerController mainAudioOutput];
|
||||
audio_output_t *p_aout = [[[[VLCMain sharedInstance] playlistController] playerController] mainAudioOutput];
|
||||
if (p_aout) {
|
||||
var_SetFloat(p_aout, "compressor-rms-peak", 0.000000);
|
||||
var_SetFloat(p_aout, "compressor-attack", 25.000000);
|
||||
@ -993,7 +985,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
|
||||
|
||||
assert(psz_property);
|
||||
|
||||
audio_output_t *p_aout = [_playerController mainAudioOutput];
|
||||
audio_output_t *p_aout = [[[[VLCMain sharedInstance] playlistController] playerController] mainAudioOutput];
|
||||
if (p_aout) {
|
||||
var_SetFloat(p_aout, psz_property, f_value);
|
||||
aout_Release(p_aout);
|
||||
@ -1055,7 +1047,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
|
||||
var_SetFloat(p_playlist, "spatializer-dry", .5);
|
||||
var_SetFloat(p_playlist, "spatializer-damp", .5);
|
||||
|
||||
audio_output_t *p_aout = [_playerController mainAudioOutput];
|
||||
audio_output_t *p_aout = [[[[VLCMain sharedInstance] playlistController] playerController] mainAudioOutput];
|
||||
if (p_aout) {
|
||||
var_SetFloat(p_aout, "spatializer-roomsize", .85);
|
||||
var_SetFloat(p_aout, "spatializer-width", 1.);
|
||||
@ -1091,7 +1083,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
|
||||
|
||||
assert(psz_property);
|
||||
|
||||
audio_output_t *p_aout = [_playerController mainAudioOutput];
|
||||
audio_output_t *p_aout = [[[[VLCMain sharedInstance] playlistController] playerController] mainAudioOutput];
|
||||
if (p_aout) {
|
||||
var_SetFloat(p_aout, psz_property, f_value / 10.f);
|
||||
aout_Release(p_aout);
|
||||
@ -1153,7 +1145,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
|
||||
|
||||
- (IBAction)filterVolumeNormSliderUpdated:(id)sender
|
||||
{
|
||||
audio_output_t *p_aout = [_playerController mainAudioOutput];
|
||||
audio_output_t *p_aout = [[[[VLCMain sharedInstance] playlistController] playerController] mainAudioOutput];
|
||||
float f_value = [_filterNormLevelSlider floatValue];
|
||||
|
||||
if (p_aout) {
|
||||
|
@ -115,23 +115,21 @@
|
||||
|
||||
/* enable the new filters */
|
||||
var_SetString(p_playlist, "video-filter", [tempString UTF8String]);
|
||||
if (vouts) {
|
||||
if (vouts)
|
||||
for (NSValue *ptr in vouts) {
|
||||
vout_thread_t *p_vout = [ptr pointerValue];
|
||||
var_SetString(p_vout, "video-filter", [tempString UTF8String]);
|
||||
}
|
||||
}
|
||||
|
||||
tempString = B64DecNSStr([items objectAtIndex:1]);
|
||||
/* enable another round of new filters */
|
||||
var_SetString(p_playlist, "sub-source", [tempString UTF8String]);
|
||||
if (vouts) {
|
||||
if (vouts)
|
||||
for (NSValue *ptr in vouts) {
|
||||
vout_thread_t *p_vout = [ptr pointerValue];
|
||||
var_SetString(p_vout, "sub-source", [tempString UTF8String]);
|
||||
vout_Release(p_vout);
|
||||
}
|
||||
}
|
||||
|
||||
tempString = B64DecNSStr([items objectAtIndex:2]);
|
||||
/* enable another round of new filters */
|
||||
|
Loading…
Reference in New Issue
Block a user