-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Fix crash issue at srs_app_encoder #908
Conversation
I think it's better to create a dummy thread for classes like the SrsEncoder which need to create thread dynamically, for example:
I recall it's a common design pattern named |
Please fix this issue at all places that use |
This is my opinion.
1. 'trd = new SrsDummyThread();' appears twice, one is on constructor, and
the other is on on_publish.
On engineering's perceive, don't repeat yourself.
2. If you create a dummy thread, you gains the overhead on a constructor
and a destructor.
If you insist on the direction on dummy thread, I will follow your idea.
2017-06-03 17:07 GMT+08:00 winlin <notifications@github.com>:
Please fix this issue for all places use trd = NULL, use the dummy thread
instead, which simply return failed when start and ignore when stop.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#908 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA-lNEbvrUwGCaRKjO6O8qSSVNk51i_Bks5sASJkgaJpZM4Nt8-O>
.
`TRANS_BY_GPT3`
|
That's sure the constructor is called multiple times in |
I have update the commit. |
Hi, thanks for your work, but I fixed it in 9ca3697 |
Root Cause:
On SrsEncoder::on_publish, if ret is equal to ERROR_ENCODER_LOOP and ffmpegs is empty.
It wouldn't create a trd object.
On SrsEncoder::on_unpublish:
Since the trd is NULL, it would crash.