fix bug of librtmp after RTMP protocol stack refined, never use cid=2 to send data.
正在显示
1 个修改的文件
包含
11 行增加
和
1 行删除
@@ -1393,7 +1393,8 @@ SrsMessageHeader::SrsMessageHeader() | @@ -1393,7 +1393,8 @@ SrsMessageHeader::SrsMessageHeader() | ||
1393 | stream_id = 0; | 1393 | stream_id = 0; |
1394 | 1394 | ||
1395 | timestamp = 0; | 1395 | timestamp = 0; |
1396 | - perfer_cid = RTMP_CID_ProtocolControl; | 1396 | + // we always use the connection chunk-id |
1397 | + perfer_cid = RTMP_CID_OverConnection; | ||
1397 | } | 1398 | } |
1398 | 1399 | ||
1399 | SrsMessageHeader::~SrsMessageHeader() | 1400 | SrsMessageHeader::~SrsMessageHeader() |
@@ -1457,6 +1458,9 @@ void SrsMessageHeader::initialize_amf0_script(int size, int stream) | @@ -1457,6 +1458,9 @@ void SrsMessageHeader::initialize_amf0_script(int size, int stream) | ||
1457 | timestamp_delta = (int32_t)0; | 1458 | timestamp_delta = (int32_t)0; |
1458 | timestamp = (int64_t)0; | 1459 | timestamp = (int64_t)0; |
1459 | stream_id = (int32_t)stream; | 1460 | stream_id = (int32_t)stream; |
1461 | + | ||
1462 | + // amf0 script use connection2 chunk-id | ||
1463 | + perfer_cid = RTMP_CID_OverConnection2; | ||
1460 | } | 1464 | } |
1461 | 1465 | ||
1462 | void SrsMessageHeader::initialize_audio(int size, u_int32_t time, int stream) | 1466 | void SrsMessageHeader::initialize_audio(int size, u_int32_t time, int stream) |
@@ -1466,6 +1470,9 @@ void SrsMessageHeader::initialize_audio(int size, u_int32_t time, int stream) | @@ -1466,6 +1470,9 @@ void SrsMessageHeader::initialize_audio(int size, u_int32_t time, int stream) | ||
1466 | timestamp_delta = (int32_t)time; | 1470 | timestamp_delta = (int32_t)time; |
1467 | timestamp = (int64_t)time; | 1471 | timestamp = (int64_t)time; |
1468 | stream_id = (int32_t)stream; | 1472 | stream_id = (int32_t)stream; |
1473 | + | ||
1474 | + // audio chunk-id | ||
1475 | + perfer_cid = RTMP_CID_Audio; | ||
1469 | } | 1476 | } |
1470 | 1477 | ||
1471 | void SrsMessageHeader::initialize_video(int size, u_int32_t time, int stream) | 1478 | void SrsMessageHeader::initialize_video(int size, u_int32_t time, int stream) |
@@ -1475,6 +1482,9 @@ void SrsMessageHeader::initialize_video(int size, u_int32_t time, int stream) | @@ -1475,6 +1482,9 @@ void SrsMessageHeader::initialize_video(int size, u_int32_t time, int stream) | ||
1475 | timestamp_delta = (int32_t)time; | 1482 | timestamp_delta = (int32_t)time; |
1476 | timestamp = (int64_t)time; | 1483 | timestamp = (int64_t)time; |
1477 | stream_id = (int32_t)stream; | 1484 | stream_id = (int32_t)stream; |
1485 | + | ||
1486 | + // video chunk-id | ||
1487 | + perfer_cid = RTMP_CID_Video; | ||
1478 | } | 1488 | } |
1479 | 1489 | ||
1480 | SrsChunkStream::SrsChunkStream(int _cid) | 1490 | SrsChunkStream::SrsChunkStream(int _cid) |
-
请 注册 或 登录 后发表评论