winlin

merge from srs2

@@ -1287,6 +1287,7 @@ Winlin @@ -1287,6 +1287,7 @@ Winlin
1287 [bug #515]: https://github.com/ossrs/srs/issues/515 1287 [bug #515]: https://github.com/ossrs/srs/issues/515
1288 [bug #511]: https://github.com/ossrs/srs/issues/511 1288 [bug #511]: https://github.com/ossrs/srs/issues/511
1289 [bug #518]: https://github.com/ossrs/srs/issues/518 1289 [bug #518]: https://github.com/ossrs/srs/issues/518
  1290 +[bug #541]: https://github.com/ossrs/srs/issues/541
1290 [bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx 1291 [bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx
1291 1292
1292 [exo #828]: https://github.com/google/ExoPlayer/pull/828 1293 [exo #828]: https://github.com/google/ExoPlayer/pull/828
@@ -1514,10 +1514,17 @@ int SrsProtocol::on_recv_message(SrsCommonMessage* msg) @@ -1514,10 +1514,17 @@ int SrsProtocol::on_recv_message(SrsCommonMessage* msg)
1514 { 1514 {
1515 srs_warn("accept chunk size %d, but should in [%d, %d], " 1515 srs_warn("accept chunk size %d, but should in [%d, %d], "
1516 "@see: https://github.com/ossrs/srs/issues/160", 1516 "@see: https://github.com/ossrs/srs/issues/160",
1517 - pkt->chunk_size, SRS_CONSTS_RTMP_MIN_CHUNK_SIZE,  
1518 - SRS_CONSTS_RTMP_MAX_CHUNK_SIZE); 1517 + pkt->chunk_size, SRS_CONSTS_RTMP_MIN_CHUNK_SIZE, SRS_CONSTS_RTMP_MAX_CHUNK_SIZE);
1519 } 1518 }
1520 1519
  1520 + // @see: https://github.com/ossrs/srs/issues/541
  1521 + if (pkt->chunk_size < SRS_CONSTS_RTMP_MIN_CHUNK_SIZE) {
  1522 + ret = ERROR_RTMP_CHUNK_SIZE;
  1523 + srs_error("chunk size should be %d+, value=%d. ret=%d",
  1524 + SRS_CONSTS_RTMP_MIN_CHUNK_SIZE, pkt->chunk_size, ret);
  1525 + return ret;
  1526 + }
  1527 +
1521 in_chunk_size = pkt->chunk_size; 1528 in_chunk_size = pkt->chunk_size;
1522 srs_trace("input chunk size to %d", pkt->chunk_size); 1529 srs_trace("input chunk size to %d", pkt->chunk_size);
1523 1530