正在显示
3 个修改的文件
包含
15 行增加
和
3 行删除
| @@ -869,7 +869,7 @@ int SrsRtmpConn::do_publishing(SrsSource* source, SrsPublishRecvThread* trd) | @@ -869,7 +869,7 @@ int SrsRtmpConn::do_publishing(SrsSource* source, SrsPublishRecvThread* trd) | ||
| 869 | pprint->elapse(); | 869 | pprint->elapse(); |
| 870 | 870 | ||
| 871 | // cond wait for error. | 871 | // cond wait for error. |
| 872 | - trd->wait(SRS_CONSTS_RTMP_RECV_TIMEOUT_US / 1000); | 872 | + trd->wait(SRS_CONSTS_RTMP_PUBLISHER_RECV_TIMEOUT_US / 1000); |
| 873 | 873 | ||
| 874 | // check the thread error code. | 874 | // check the thread error code. |
| 875 | if ((ret = trd->error_code()) != ERROR_SUCCESS) { | 875 | if ((ret = trd->error_code()) != ERROR_SUCCESS) { |
| @@ -1479,7 +1479,11 @@ int SrsSource::on_audio(SrsCommonMessage* shared_audio) | @@ -1479,7 +1479,11 @@ int SrsSource::on_audio(SrsCommonMessage* shared_audio) | ||
| 1479 | } | 1479 | } |
| 1480 | 1480 | ||
| 1481 | // consume the monotonically increase message. | 1481 | // consume the monotonically increase message. |
| 1482 | - ret = on_audio_imp(m); | 1482 | + if (m->is_audio()) { |
| 1483 | + ret = on_audio_imp(m); | ||
| 1484 | + } else { | ||
| 1485 | + ret = on_video_imp(m); | ||
| 1486 | + } | ||
| 1483 | srs_freep(m); | 1487 | srs_freep(m); |
| 1484 | 1488 | ||
| 1485 | return ret; | 1489 | return ret; |
| @@ -1670,7 +1674,11 @@ int SrsSource::on_video(SrsCommonMessage* shared_video) | @@ -1670,7 +1674,11 @@ int SrsSource::on_video(SrsCommonMessage* shared_video) | ||
| 1670 | SrsAutoFree(SrsSharedPtrMessage, m); | 1674 | SrsAutoFree(SrsSharedPtrMessage, m); |
| 1671 | 1675 | ||
| 1672 | // consume the monotonically increase message. | 1676 | // consume the monotonically increase message. |
| 1673 | - ret = on_video_imp(m); | 1677 | + if (m->is_audio()) { |
| 1678 | + ret = on_audio_imp(m); | ||
| 1679 | + } else { | ||
| 1680 | + ret = on_video_imp(m); | ||
| 1681 | + } | ||
| 1674 | srs_freep(m); | 1682 | srs_freep(m); |
| 1675 | 1683 | ||
| 1676 | return ret; | 1684 | return ret; |
| @@ -74,6 +74,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -74,6 +74,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 74 | // the timeout to wait client data, | 74 | // the timeout to wait client data, |
| 75 | // if timeout, close the connection. | 75 | // if timeout, close the connection. |
| 76 | #define SRS_CONSTS_RTMP_RECV_TIMEOUT_US (int64_t)(30*1000*1000LL) | 76 | #define SRS_CONSTS_RTMP_RECV_TIMEOUT_US (int64_t)(30*1000*1000LL) |
| 77 | +// the timeout for publish recv. | ||
| 78 | +// we must use more smaller timeout, for the recv never know the status | ||
| 79 | +// of underlayer socket. | ||
| 80 | +#define SRS_CONSTS_RTMP_PUBLISHER_RECV_TIMEOUT_US (int64_t)(3*1000*1000LL) | ||
| 77 | 81 | ||
| 78 | // the timeout to wait for client control message, | 82 | // the timeout to wait for client control message, |
| 79 | // if timeout, we generally ignore and send the data to client, | 83 | // if timeout, we generally ignore and send the data to client, |
-
请 注册 或 登录 后发表评论