Commit 33f57648 authored by Martin Finkel's avatar Martin Finkel

Revert "media: fix async usage"

This reverts commit 18611f09.
Task never returns because the reverse native callback doesn't set the tcs properly.
parent 18611f09
......@@ -444,10 +444,10 @@ namespace LibVLCSharp.Shared
/// </param>
/// <param name="cancellationToken">token to cancel the operation</param>
/// <returns>the parse status of the media</returns>
public Task<MediaParsedStatus> Parse(MediaParseOptions options = MediaParseOptions.ParseLocal, int timeout = -1, CancellationToken cancellationToken = default)
public async Task<MediaParsedStatus> Parse(MediaParseOptions options = MediaParseOptions.ParseLocal, int timeout = -1, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
var tcs = new TaskCompletionSource<MediaParsedStatus>();
var cancellationTokenRegistration = cancellationToken.Register(() =>
{
......@@ -469,7 +469,7 @@ namespace LibVLCSharp.Shared
tcs.TrySetResult(MediaParsedStatus.Failed);
}
return tcs.Task;
return await tcs.Task.ConfigureAwait(false);
}
finally
{
......
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