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
LibVLCSharp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
77
Issues
77
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
LibVLCSharp
Commits
18611f09
Commit
18611f09
authored
Jul 28, 2020
by
Martin Finkel
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
media: fix async usage
parent
6bc1a352
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/LibVLCSharp/Shared/Media.cs
src/LibVLCSharp/Shared/Media.cs
+3
-3
No files found.
src/LibVLCSharp/Shared/Media.cs
View file @
18611f09
...
@@ -444,10 +444,10 @@ namespace LibVLCSharp.Shared
...
@@ -444,10 +444,10 @@ namespace LibVLCSharp.Shared
/// </param>
/// </param>
/// <param name="cancellationToken">token to cancel the operation</param>
/// <param name="cancellationToken">token to cancel the operation</param>
/// <returns>the parse status of the media</returns>
/// <returns>the parse status of the media</returns>
public
async
Task
<
MediaParsedStatus
>
Parse
(
MediaParseOptions
options
=
MediaParseOptions
.
ParseLocal
,
int
timeout
=
-
1
,
CancellationToken
cancellationToken
=
default
)
public
Task
<
MediaParsedStatus
>
Parse
(
MediaParseOptions
options
=
MediaParseOptions
.
ParseLocal
,
int
timeout
=
-
1
,
CancellationToken
cancellationToken
=
default
)
{
{
cancellationToken
.
ThrowIfCancellationRequested
();
cancellationToken
.
ThrowIfCancellationRequested
();
var
tcs
=
new
TaskCompletionSource
<
MediaParsedStatus
>();
var
tcs
=
new
TaskCompletionSource
<
MediaParsedStatus
>();
var
cancellationTokenRegistration
=
cancellationToken
.
Register
(()
=>
var
cancellationTokenRegistration
=
cancellationToken
.
Register
(()
=>
{
{
...
@@ -469,7 +469,7 @@ namespace LibVLCSharp.Shared
...
@@ -469,7 +469,7 @@ namespace LibVLCSharp.Shared
tcs
.
TrySetResult
(
MediaParsedStatus
.
Failed
);
tcs
.
TrySetResult
(
MediaParsedStatus
.
Failed
);
}
}
return
await
tcs
.
Task
.
ConfigureAwait
(
false
)
;
return
tcs
.
Task
;
}
}
finally
finally
{
{
...
...
Martin Finkel
@mfkl
mentioned in commit
33f57648
·
Jul 30, 2020
mentioned in commit
33f57648
mentioned in commit 33f57648e3009212a387071b1c089287d727ecb7
Toggle commit list
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