-
-
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
srt publish core dump bug #2429
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -284,12 +284,14 @@ srs_error_t rtmp_client::connect() { | |
_rtmp_conn_ptr = std::make_shared<SrsSimpleRtmpClient>(_url, cto, sto); | ||
|
||
if ((err = _rtmp_conn_ptr->connect()) != srs_success) { | ||
srs_error("rtmp client in srt2rtmp connect fail url:%s", _url.c_str()); | ||
close(); | ||
return srs_error_wrap(err, "connect %s failed, cto=%dms, sto=%dms.", | ||
_url.c_str(), srsu2msi(cto), srsu2msi(sto)); | ||
} | ||
|
||
if ((err = _rtmp_conn_ptr->publish(SRS_CONSTS_RTMP_PROTOCOL_CHUNK_SIZE)) != srs_success) { | ||
srs_error("rtmp client in srt2rtmp publish fail url:%s", _url.c_str()); | ||
close(); | ||
return srs_error_wrap(err, "publish error, url:%s", _url.c_str()); | ||
} | ||
|
@@ -406,13 +408,18 @@ srs_error_t rtmp_client::rtmp_write_packet(char type, uint32_t timestamp, char* | |
srs_error_t err = srs_success; | ||
SrsSharedPtrMessage* msg = NULL; | ||
|
||
if (!_rtmp_conn_ptr) { | ||
return srs_error_wrap(err, "rtmp connection is close"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At this time, when err is success, wrap(success) will cause the code outside to be success, which is incorrect. Here, the error should be created using srs_error_new.
|
||
} | ||
|
||
if ((err = srs_rtmp_create_msg(type, timestamp, data, size, _rtmp_conn_ptr->sid(), &msg)) != srs_success) { | ||
return srs_error_wrap(err, "create message"); | ||
} | ||
srs_assert(msg); | ||
|
||
// send out encoded msg. | ||
if ((err = _rtmp_conn_ptr->send_and_free_message(msg)) != srs_success) { | ||
srs_error("rtmp client in srt2rtmp send message fail, url:%s", _url.c_str()); | ||
close(); | ||
return srs_error_wrap(err, "send messages"); | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this print statement for debugging purposes? It might be better to print it in the outer layer, because here err is returned, and there might be duplicate logging outside as well.
If you need the information of _url, it is already included when wrapping err.
TRANS_BY_GPT3