winlin

fix #749, timestamp overflow for ATC. 2.0.230

@@ -345,6 +345,7 @@ Remark: @@ -345,6 +345,7 @@ Remark:
345 345
346 ## History 346 ## History
347 347
  348 +* v2.0, 2017-01-18, fix [#749][bug #749], timestamp overflow for ATC. 2.0.230
348 * v2.0, 2017-01-11, fix [#740][bug #740], convert ts aac audio private stream 1 to common. 2.0.229 349 * v2.0, 2017-01-11, fix [#740][bug #740], convert ts aac audio private stream 1 to common. 2.0.229
349 * v2.0, 2017-01-11, fix [#588][bug #588], kbps interface error. 2.0.228 350 * v2.0, 2017-01-11, fix [#588][bug #588], kbps interface error. 2.0.228
350 * v2.0, 2017-01-11, fix [#736][bug #736], recovery the hls dispose. 2.0.227 351 * v2.0, 2017-01-11, fix [#736][bug #736], recovery the hls dispose. 2.0.227
@@ -1277,6 +1278,7 @@ Winlin @@ -1277,6 +1278,7 @@ Winlin
1277 [bug #736]: https://github.com/ossrs/srs/issues/736 1278 [bug #736]: https://github.com/ossrs/srs/issues/736
1278 [bug #588]: https://github.com/ossrs/srs/issues/588 1279 [bug #588]: https://github.com/ossrs/srs/issues/588
1279 [bug #740]: https://github.com/ossrs/srs/issues/740 1280 [bug #740]: https://github.com/ossrs/srs/issues/740
  1281 +[bug #749]: https://github.com/ossrs/srs/issues/749
1280 [bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx 1282 [bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx
1281 1283
1282 [exo #828]: https://github.com/google/ExoPlayer/pull/828 1284 [exo #828]: https://github.com/google/ExoPlayer/pull/828
@@ -490,10 +490,20 @@ int SrsConsumer::enqueue(SrsSharedPtrMessage* shared_msg, bool atc, SrsRtmpJitte @@ -490,10 +490,20 @@ int SrsConsumer::enqueue(SrsSharedPtrMessage* shared_msg, bool atc, SrsRtmpJitte
490 int duration_ms = queue->duration(); 490 int duration_ms = queue->duration();
491 bool match_min_msgs = queue->size() > mw_min_msgs; 491 bool match_min_msgs = queue->size() > mw_min_msgs;
492 492
  493 + // For ATC, maybe the SH timestamp bigger than A/V packet,
  494 + // when encoder republish or overflow.
  495 + // @see https://github.com/ossrs/srs/pull/749
  496 + if (atc && duration_ms < 0) {
  497 + st_cond_signal(mw_wait);
  498 + mw_waiting = false;
  499 + return ret;
  500 + }
  501 +
493 // when duration ok, signal to flush. 502 // when duration ok, signal to flush.
494 if (match_min_msgs && duration_ms > mw_duration) { 503 if (match_min_msgs && duration_ms > mw_duration) {
495 st_cond_signal(mw_wait); 504 st_cond_signal(mw_wait);
496 mw_waiting = false; 505 mw_waiting = false;
  506 + return ret;
497 } 507 }
498 } 508 }
499 #endif 509 #endif
@@ -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 229 34 +#define VERSION_REVISION 230
35 35
36 // generated by configure, only macros. 36 // generated by configure, only macros.
37 #include <srs_auto_headers.hpp> 37 #include <srs_auto_headers.hpp>