Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC-iOS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
311
Issues
311
List
Boards
Labels
Service Desk
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
VLC-iOS
Commits
e6275391
Commit
e6275391
authored
Jan 08, 2014
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
local network: fix UI lockup (close #10329)
parent
3e014f76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
8 deletions
+46
-8
Sources/VLCLocalServerListViewController.m
Sources/VLCLocalServerListViewController.m
+46
-8
No files found.
Sources/VLCLocalServerListViewController.m
View file @
e6275391
...
...
@@ -23,6 +23,7 @@
#import "VLCNetworkLoginViewController.h"
#import "UINavigationController+Theme.h"
#import "VLCPlaylistViewController.h"
#import "Reachability.h"
@interface
VLCLocalServerListViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
,
NSNetServiceBrowserDelegate
,
VLCNetworkLoginViewController
,
NSNetServiceDelegate
,
VLCMediaListDelegate
>
{
...
...
@@ -42,6 +43,9 @@
UIRefreshControl
*
_refreshControl
;
UIActivityIndicatorView
*
_activityIndicator
;
Reachability
*
_reachability
;
BOOL
_udnpDiscoveryRunning
;
}
@end
...
...
@@ -50,6 +54,7 @@
-
(
void
)
dealloc
{
[
_reachability
stopNotifier
];
[
_ftpNetServiceBrowser
stop
];
}
...
...
@@ -93,8 +98,7 @@
_ftpNetServiceBrowser
=
[[
NSNetServiceBrowser
alloc
]
init
];
_ftpNetServiceBrowser
.
delegate
=
self
;
[
self
performSelectorInBackground
:
@selector
(
_startUPNPDiscovery
)
withObject
:
nil
];
[
self
performSelectorInBackground
:
@selector
(
_startSAPDiscovery
)
withObject
:
nil
];
[
self
_triggerNetServiceBrowser
];
_refreshControl
=
[[
UIRefreshControl
alloc
]
init
];
[
_refreshControl
addTarget
:
self
action
:
@selector
(
handleRefresh
)
forControlEvents
:
UIControlEventValueChanged
];
...
...
@@ -106,6 +110,13 @@
_loginViewController
=
[[
VLCNetworkLoginViewController
alloc
]
initWithNibName
:
@"VLCNetworkLoginViewController"
bundle
:
nil
];
_loginViewController
.
delegate
=
self
;
_reachability
=
[
Reachability
reachabilityForLocalWiFi
];
[
_reachability
startNotifier
];
[
self
netReachabilityChanged
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
netReachabilityChanged
:
)
name
:
kReachabilityChangedNotification
object
:
nil
];
}
-
(
void
)
viewWillDisappear
:(
BOOL
)
animated
...
...
@@ -119,9 +130,21 @@
{
[
_activityIndicator
stopAnimating
];
[
super
viewWillAppear
:
animated
];
[
self
_triggerNetServiceBrowser
];
[
self
performSelectorInBackground
:
@selector
(
_startUPNPDiscovery
)
withObject
:
nil
];
[
self
performSelectorInBackground
:
@selector
(
_startSAPDiscovery
)
withObject
:
nil
];
[
self
netReachabilityChanged
:
nil
];
}
-
(
void
)
netReachabilityChanged
:(
NSNotification
*
)
notification
{
if
(
_reachability
.
currentReachabilityStatus
==
ReachableViaWiFi
)
{
[
self
_triggerNetServiceBrowser
];
[
self
performSelectorInBackground
:
@selector
(
_startUPNPDiscovery
)
withObject
:
nil
];
[
self
performSelectorInBackground
:
@selector
(
_startSAPDiscovery
)
withObject
:
nil
];
}
else
{
[
_ftpNetServiceBrowser
stop
];
[
self
_stopUPNPDiscovery
];
[
self
_stopSAPDiscovery
];
}
}
-
(
void
)
_triggerNetServiceBrowser
...
...
@@ -131,6 +154,9 @@
-
(
void
)
_startUPNPDiscovery
{
if
(
_reachability
.
currentReachabilityStatus
!=
ReachableViaWiFi
)
return
;
UPnPManager
*
managerInstance
=
[
UPnPManager
GetInstance
];
_UPNPdevices
=
[[
managerInstance
DB
]
rootDevices
];
...
...
@@ -147,13 +173,22 @@
[[
managerInstance
SSDP
]
startSSDP
];
[[
managerInstance
SSDP
]
searchSSDP
];
[[
managerInstance
SSDP
]
SSDPDBUpdate
];
_udnpDiscoveryRunning
=
YES
;
}
-
(
void
)
_stopUPNPDiscovery
{
if
(
_udnpDiscoveryRunning
)
{
UPnPManager
*
managerInstance
=
[
UPnPManager
GetInstance
];
[[
managerInstance
DB
]
removeObserver
:(
UPnPDBObserver
*
)
self
];
[[
managerInstance
SSDP
]
stopSSDP
];
_udnpDiscoveryRunning
=
NO
;
}
}
-
(
IBAction
)
goBack
:(
id
)
sender
{
UPnPManager
*
managerInstance
=
[
UPnPManager
GetInstance
];
[[
managerInstance
DB
]
removeObserver
:(
UPnPDBObserver
*
)
self
];
[[
managerInstance
SSDP
]
stopSSDP
];
[
self
_stopUPNPDiscovery
];
[
self
_stopSAPDiscovery
];
[[(
VLCAppDelegate
*
)[
UIApplication
sharedApplication
].
delegate
revealController
]
toggleSidebar
:
!
[(
VLCAppDelegate
*
)[
UIApplication
sharedApplication
].
delegate
revealController
].
sidebarShowing
duration
:
kGHRevealSidebarDefaultAnimationDuration
];
...
...
@@ -407,6 +442,9 @@
if
(
!
SYSTEM_RUNS_IOS7_OR_LATER
)
return
;
if
(
_reachability
.
currentReachabilityStatus
!=
ReachableViaWiFi
)
return
;
_sapDiscoverer
=
[[
VLCMediaDiscoverer
alloc
]
initWithName
:
@"sap"
];
_sapDiscoverer
.
discoveredMedia
.
delegate
=
self
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment