From bd158ec838b4592afd809b9e969d466d8d70be8c Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 19 Oct 2014 11:33:56 +0800 Subject: [PATCH] hotfix for bug #183, donot support AnnexB when decoding RTMP body for HLS. 1.0.1. --- README.md | 1 + trunk/src/app/srs_app_avc_aac.cpp | 9 +++++++++ trunk/src/core/srs_core.hpp | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 35e0c6f88..32ca35ca6 100755 --- a/README.md +++ b/README.md @@ -202,6 +202,7 @@ Supported operating systems and hardware: * 2013-10-17, Created.
## History +* 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. * 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. * 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. * v1.0, 2014-10-08, fix [#162](https://github.com/winlinvip/simple-rtmp-server/issues/162), failed if no epoll. 0.9.222. diff --git a/trunk/src/app/srs_app_avc_aac.cpp b/trunk/src/app/srs_app_avc_aac.cpp index 752a5d9a5..9682a0f7b 100644 --- a/trunk/src/app/srs_app_avc_aac.cpp +++ b/trunk/src/app/srs_app_avc_aac.cpp @@ -473,6 +473,15 @@ int SrsAvcAacCodec::video_avc_demux(char* data, int size, SrsCodecSample* sample } else { NALUnitLength = stream->read_1bytes(); } + + // maybe stream is AnnexB format. + // see: https://github.com/winlinvip/simple-rtmp-server/issues/183 + if (NALUnitLength < 0) { + ret = ERROR_HLS_DECODE_ERROR; + srs_error("maybe stream is AnnexB format. ret=%d", ret); + return ret; + } + // NALUnit if (!stream->require(NALUnitLength)) { ret = ERROR_HLS_DECODE_ERROR; diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 96db79391..b08f4a661 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR "1" #define VERSION_MINOR "0" -#define VERSION_REVISION "0" +#define VERSION_REVISION "1" #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION // server info. #define RTMP_SIG_SRS_KEY "SRS"