winlin

hotfix for bug #183, donot support AnnexB when decoding RTMP body for HLS. 1.0.1.

@@ -202,6 +202,7 @@ Supported operating systems and hardware: @@ -202,6 +202,7 @@ Supported operating systems and hardware:
202 * 2013-10-17, Created.<br/> 202 * 2013-10-17, Created.<br/>
203 203
204 ## History 204 ## History
  205 +* v1.0, 2014-10-19, fix [#183](https://github.com/winlinvip/simple-rtmp-server/issues/183), hotfix for bug #183, donot support AnnexB when decoding RTMP body for HLS. 1.0.1.
205 * <strong>v1.0, 2014-10-09, [1.0 beta(1.0.0)](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0.beta) released. 59316 lines.</strong> 206 * <strong>v1.0, 2014-10-09, [1.0 beta(1.0.0)](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0.beta) released. 59316 lines.</strong>
206 * v1.0, 2014-10-08, fix [#151](https://github.com/winlinvip/simple-rtmp-server/issues/151), always reap ts whatever audio or video packet. 0.9.223. 207 * v1.0, 2014-10-08, fix [#151](https://github.com/winlinvip/simple-rtmp-server/issues/151), always reap ts whatever audio or video packet. 0.9.223.
207 * v1.0, 2014-10-08, fix [#162](https://github.com/winlinvip/simple-rtmp-server/issues/162), failed if no epoll. 0.9.222. 208 * v1.0, 2014-10-08, fix [#162](https://github.com/winlinvip/simple-rtmp-server/issues/162), failed if no epoll. 0.9.222.
@@ -473,6 +473,15 @@ int SrsAvcAacCodec::video_avc_demux(char* data, int size, SrsCodecSample* sample @@ -473,6 +473,15 @@ int SrsAvcAacCodec::video_avc_demux(char* data, int size, SrsCodecSample* sample
473 } else { 473 } else {
474 NALUnitLength = stream->read_1bytes(); 474 NALUnitLength = stream->read_1bytes();
475 } 475 }
  476 +
  477 + // maybe stream is AnnexB format.
  478 + // see: https://github.com/winlinvip/simple-rtmp-server/issues/183
  479 + if (NALUnitLength < 0) {
  480 + ret = ERROR_HLS_DECODE_ERROR;
  481 + srs_error("maybe stream is AnnexB format. ret=%d", ret);
  482 + return ret;
  483 + }
  484 +
476 // NALUnit 485 // NALUnit
477 if (!stream->require(NALUnitLength)) { 486 if (!stream->require(NALUnitLength)) {
478 ret = ERROR_HLS_DECODE_ERROR; 487 ret = ERROR_HLS_DECODE_ERROR;
@@ -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 "1" 32 #define VERSION_MAJOR "1"
33 #define VERSION_MINOR "0" 33 #define VERSION_MINOR "0"
34 -#define VERSION_REVISION "0" 34 +#define VERSION_REVISION "1"
35 #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION 35 #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
36 // server info. 36 // server info.
37 #define RTMP_SIG_SRS_KEY "SRS" 37 #define RTMP_SIG_SRS_KEY "SRS"