From 310032d8d813e40c854421fd968557c57895476f Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 18 Jan 2017 11:48:31 +0800 Subject: [PATCH] merge srs2, timestamp overflow for ATC. --- README.md | 2 ++ trunk/src/app/srs_app_rtmp_conn.cpp | 2 +- trunk/src/app/srs_app_source.cpp | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e70995fc8..79dd92b8b 100755 --- a/README.md +++ b/README.md @@ -205,6 +205,7 @@ Please select your language: ### V2 changes +* v2.0, 2017-01-18, fix [#749][bug #749], timestamp overflow for ATC. 2.0.230 * v2.0, 2017-01-11, fix [#740][bug #740], convert ts aac audio private stream 1 to common. 2.0.229 * v2.0, 2017-01-11, fix [#588][bug #588], kbps interface error. 2.0.228 * v2.0, 2017-01-11, fix [#736][bug #736], recovery the hls dispose. 2.0.227 @@ -1363,6 +1364,7 @@ Winlin [bug #736]: https://github.com/ossrs/srs/issues/736 [bug #588]: https://github.com/ossrs/srs/issues/588 [bug #740]: https://github.com/ossrs/srs/issues/740 +[bug #749]: https://github.com/ossrs/srs/issues/749 [bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx [bug #735]: https://github.com/ossrs/srs/issues/735 diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index 2cea530cd..7a056d2db 100644 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -1080,7 +1080,7 @@ int SrsRtmpConn::do_publishing(SrsSource* source, SrsPublishRecvThread* trd) // initialize the publish timeout. publish_1stpkt_timeout = _srs_config->get_publish_1stpkt_timeout(req->vhost); - publish_normal_timeout = _srs_config->get_publish_1stpkt_timeout(req->vhost); + publish_normal_timeout = _srs_config->get_publish_normal_timeout(req->vhost); // set the sock options. set_sock_options(); diff --git a/trunk/src/app/srs_app_source.cpp b/trunk/src/app/srs_app_source.cpp index fdbde22c4..aa55396f6 100755 --- a/trunk/src/app/srs_app_source.cpp +++ b/trunk/src/app/srs_app_source.cpp @@ -491,10 +491,20 @@ int SrsConsumer::enqueue(SrsSharedPtrMessage* shared_msg, bool atc, SrsRtmpJitte int duration_ms = queue->duration(); bool match_min_msgs = queue->size() > mw_min_msgs; + // For ATC, maybe the SH timestamp bigger than A/V packet, + // when encoder republish or overflow. + // @see https://github.com/ossrs/srs/pull/749 + if (atc && duration_ms < 0) { + st_cond_signal(mw_wait); + mw_waiting = false; + return ret; + } + // when duration ok, signal to flush. if (match_min_msgs && duration_ms > mw_duration) { st_cond_signal(mw_wait); mw_waiting = false; + return ret; } } #endif