sipsorcery-org / SIPSorceryMedia.FFmpeg

GNU Lesser General Public License v2.1
34 stars 26 forks source link

For coherency remove event OnEndOfFile and use instead OnAudioSourceError or OnVideoSourceError. #38

Closed ChristopheI closed 2 years ago

ChristopheI commented 2 years ago

Remove event OnEndOfFile in AudioSource, FileSource and VideoSource. Use instead OnAudioSourceError or OnVideoSourceError.

The goal is to be coherent when a source is not accessible OR no more accessible. The source is no more accessible when the device in use is unplugged for example or if the file (remote/local) is no more accessible (network trouble, ...)

FFmpeg raises an error when a source is not accessible (so in initialization step) but it raises EOF when it's no more accessible ...

On a file device if the "loop" option is used, error event is not triggered immediately on EOF. Because it's not possible to know is EOF is really reached or if the file is no more accessible. The init step is started and if it fails the error event if raised