My application writes files with video and audio data (MPEG2 Program Stream).
I need to open these files exclusively, that is so, that any other process cannot open these files until my application finishes writing and closes them.
These files are ordinary files, not special devices or protocols, like rtsp://, http://, etc.
How do I get the file descriptor from AVFormatContext in order to use flock()?
Or, is there any other way to lock files, created by libav?