Closed tihomirptotev closed 3 weeks ago
I'll be honest I don't see anything wrong in the code you've shared 🤔 Are you using interrupter
anywhere else?
This function is the only place I create and use the interrupter.
Immediate exit requested
can come from different places, but it can come from interrupter.Interrupt()
being called. Therefore what seems to be happening is that interrupter.Interrupt()
is called for your other HTTP streams. But in the code you've shared, I don't see how it would happen 🤔
I have an application that spawns several goroutines, each reading from an HTTP URL using go-astiav v0.21.0 and saving the data to a buffer for further processing. For a particular URL, the connection remains open, but no data is received, causing the inputFormatContext.OpenInput method to block for several minutes before returning. To solve this, I create an interrupter using inputFormatContext.SetInterruptCallback() and call interrupter.Interrupt() in another goroutine if the OpenInput method has not returned after a timeout period. This solution works fine.
However, for other HTTP streams, I often encounter an "Immediate exit requested" error from inputFormatContext.ReadFrame without any FFmpeg logs. If I do not set the interrupter callback, no errors are returned from the ReadFrame method. Can you help me with this error, please?
Thanks!
This is the application code:
func (r *StreamReader) readHttpSource(url string) error {
}