I have an application that opens two url video streams on separate threads. When attempting to connect to a URL av_open_input_file can take a long time to return if the url has a valid IP Address but no video stream. To force a faster timeout I implemented a simple callback function (using url_set_interrupt_cb) that keeps track of the time since av_open_input_file was called. If the elapsed time is greater than desired I return an error. This works well for one stream but because the callback function is global it has the ability to return errors in secondary streams. For example the following steps cause both threads to shut down:
1. Thread 1 starts a connects to a url video stream. 2. Thread 2 starts and attempts to connect to a secondary url stream. 3. Thread 2 times out and returns an error. 4. Thread 1 receives the same error while decoding disconnects. Does anyone have any ideas to effectively implement the timeout while allowing a secondary thread to continue decoding a video stream? Regards, B. Stieber _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
