winlin

fix #541, failed when chunk size too small. 2.0.202

@@ -337,6 +337,7 @@ Remark: @@ -337,6 +337,7 @@ Remark:
337 337
338 ## History 338 ## History
339 339
  340 +* v2.0, 2015-12-22, for [#541][bug #541] failed when chunk size too small. 2.0.202
340 * v2.0, 2015-12-15, default hls_on_error to continue. 2.0.201 341 * v2.0, 2015-12-15, default hls_on_error to continue. 2.0.201
341 * v2.0, 2015-11-16, for [#518][bug #518] fix fd leak bug when fork. 2.0.200 342 * v2.0, 2015-11-16, for [#518][bug #518] fix fd leak bug when fork. 2.0.200
342 * v2.0, 2015-11-05, for [#511][bug #511] fix bug for restart thread. 2.0.199 343 * v2.0, 2015-11-05, for [#511][bug #511] fix bug for restart thread. 2.0.199
@@ -1207,6 +1208,7 @@ Winlin @@ -1207,6 +1208,7 @@ Winlin
1207 [bug #515]: https://github.com/ossrs/srs/issues/515 1208 [bug #515]: https://github.com/ossrs/srs/issues/515
1208 [bug #511]: https://github.com/ossrs/srs/issues/511 1209 [bug #511]: https://github.com/ossrs/srs/issues/511
1209 [bug #518]: https://github.com/ossrs/srs/issues/518 1210 [bug #518]: https://github.com/ossrs/srs/issues/518
  1211 +[bug #541]: https://github.com/ossrs/srs/issues/541
1210 [bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx 1212 [bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx
1211 1213
1212 [exo #828]: https://github.com/google/ExoPlayer/pull/828 1214 [exo #828]: https://github.com/google/ExoPlayer/pull/828
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 // current release version 31 // current release version
32 #define VERSION_MAJOR 2 32 #define VERSION_MAJOR 2
33 #define VERSION_MINOR 0 33 #define VERSION_MINOR 0
34 -#define VERSION_REVISION 201 34 +#define VERSION_REVISION 202
35 35
36 // server info. 36 // server info.
37 #define RTMP_SIG_SRS_KEY "SRS" 37 #define RTMP_SIG_SRS_KEY "SRS"
@@ -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