cmxl / FFmpeg.NET

.NET wrapper for common ffmpeg tasks
MIT License
611 stars 99 forks source link

All async+await calls need ConfigureAwait(false) #32

Closed CameronWills closed 3 years ago

CameronWills commented 5 years ago

Unless there is a good reason to have the thread SynchronizationContext preserved, all of your await ...calls throughout the library should have .ConfigureAwait(false) appended.

Not having this causes deadlocks when having to call your library in a synchronous manner such as: var meta = ffmpeg.GetMetaDataAsync(input).GetAwaiter().GetResult();

Obviously you would ideally not call it this way using .GetAwaiter().GetResult() and instead use async+await 'all the way down'. But sometimes this is not an option.