Request for help on astiav.IOInterrupter #82
-
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. Thanks! This is the application code: func (r *StreamReader) readHttpSource(url string) error {
} |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
I'll be honest I don't see anything wrong in the code you've shared 🤔 Are you using |
Beta Was this translation helpful? Give feedback.
-
This function is the only place I create and use the interrupter. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Have you made progress on your issue? If not, do you have some code I can run on my machine to reproduce (I can't use the one you've shared without the correct urls) ? |
Beta Was this translation helpful? Give feedback.
-
The "Immediate exit requested" error in inputFormatContext.SetInterruptCallback() was likely related to my application code. I created a sample app with several goroutines reading from HTTP sources using go-astiav with an interrupt callback, and I never encountered this type of error. After refactoring and simplifying my code, the "Immediate exit requested" error no longer occurs. Thank you! |
Beta Was this translation helpful? Give feedback.
The "Immediate exit requested" error in inputFormatContext.SetInterruptCallback() was likely related to my application code. I created a sample app with several goroutines reading from HTTP sources using go-astiav with an interrupt callback, and I never encountered this type of error. After refactoring and simplifying my code, the "Immediate exit requested" error no longer occurs.
Thank you!