-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Regression with commit bc2f48e057644ab9 #3098
Comments
The problem is that inside of startup(), the state of m_bGCStatus is checked which causes an early return, before m_iInstanceCount is incremented, so the reference counting is busted. |
Still a leftover issue though. I can finish the work, if you want to offer some guidance @maxsharabayko |
Ok, I don't know how this slipped, but indeed the call to So, moving that instruction up was right, just not before increasing the instance counter. Also all other changes should stay. |
The problem with the other two changes I mentioned is that with my fix, the counter is also increased in Offhand I think there should be another boolean to track an implicit startup() call has be called, avoid calling it multiple times, and decide if an implicit clean() should be called in Other option would be to add implicit |
also change how the implicit startup is tracked. The extra change is needed since the startup() calls in srt::CUDT::socket() and srt::CUDT::createGroup would endlessly increment the startup counter as sockets were created. This also adds handling for the case where the user code fails to call srt_startup when initially using the library, but does later on. It better matches up the implicit startup() with an implicit cleanup(). fixes Haivision#3098
also change how the implicit startup is tracked. The extra change is needed since the startup() calls in srt::CUDT::socket() and srt::CUDT::createGroup would endlessly increment the startup counter as sockets were created. This also adds handling for the case where the user code fails to call srt_startup when initially using the library, but does later on. It better matches up the implicit startup() with an implicit cleanup(). fixes Haivision#3098
Change how the implicit startup is tracked. The extra change is needed since the startup() calls in srt::CUDT::socket() and srt::CUDT::createGroup would endlessly increment the startup counter as sockets were created otherwise. Force a clean() when the singleton is getting destructed. Previously it just did a single decrement of the instance count, which could result in attempting to exit without actually cleaning up. fixes Haivision#3098
Change how the implicit startup is tracked. The extra change is needed since the startup() calls in srt::CUDT::socket() and srt::CUDT::createGroup would endlessly increment the startup counter as sockets were created otherwise. Force a clean() when the singleton is getting destructed. Previously it just did a single decrement of the instance count, which could result in attempting to exit without actually cleaning up. fixes Haivision#3098
Change how the implicit startup is tracked. The extra change is needed since the startup() calls in srt::CUDT::socket() and srt::CUDT::createGroup would endlessly increment the startup counter as sockets were created otherwise. Force a clean() when the singleton is getting destructed. Previously it just did a single decrement of the instance count, which could result in attempting to exit without actually cleaning up. fixes Haivision#3098
Describe the bug
My application links with the FFmpeg libraries directly. I just updated to FFmpeg 7.1 along with SRT 1.5.4. In one process I have 2 listeners that are sending active video streams. If I shut down one of the streams, the other one which is totally unrelated goes into an error state and needs to be restarted. The following errors are printed from FFmpeg:
I've re-built libsrt commits until I tracked down the one where this starts occurring, and it's bc2f48e @maxsharabayko
Now, the one thing I do differently in my FFmpeg fork, is I call
srt_startup()
inavformat_network_init()
, andsrt_cleanup()
inavformat_network_deinit()
. These are called at process start/end, since I don't want to be tearing down and re-starting the SRT library every time I shutdown/start a SRT stream.From the documentation, this seems like it should be fine, right?
Any ideas why this is causing a regression?
Thanks
Desktop (please provide the following information):
The text was updated successfully, but these errors were encountered: