Fixed ambiguous method call

The two constructors were causing issues with ambiguous method calls but are a good idea, so this is more of a workaround.
Error message:
The call is ambiguous between the following methods or properties:
'FFMpegCore.Pipes.RawVideoPipeSource.RawVideoPipeSource(System.Collections.Generic.IEnumerator<FFMpegCore.Pipes.IVideoFrame>)' and
'FFMpegCore.Pipes.RawVideoPipeSource.RawVideoPipeSource(System.Collections.Generic.IEnumerable<FFMpegCore.Pipes.IVideoFrame>)'
This commit is contained in:
Dimitri Vranken 2023-02-16 14:48:06 +01:00
parent f3c7df1ff5
commit 7b32ba5a27

View file

@ -15,13 +15,11 @@ public class RawVideoPipeSource : IPipeSource
private bool _formatInitialized; private bool _formatInitialized;
private readonly IEnumerator<IVideoFrame> _framesEnumerator; private readonly IEnumerator<IVideoFrame> _framesEnumerator;
public RawVideoPipeSource(IEnumerator<IVideoFrame> framesEnumerator) public RawVideoPipeSource(IEnumerable<IVideoFrame> framesEnumerator)
{ {
_framesEnumerator = framesEnumerator; _framesEnumerator = framesEnumerator.GetEnumerator();
} }
public RawVideoPipeSource(IEnumerable<IVideoFrame> framesEnumerator) : this(framesEnumerator.GetEnumerator()) { }
public string GetStreamArguments() public string GetStreamArguments()
{ {
if (!_formatInitialized) if (!_formatInitialized)