winlin

merge from 1.0release for #268, the hls pcr is negative when startup. 2.0.78

@@ -501,8 +501,9 @@ Supported operating systems and hardware: @@ -501,8 +501,9 @@ Supported operating systems and hardware:
501 * 2013-10-17, Created.<br/> 501 * 2013-10-17, Created.<br/>
502 502
503 ## History 503 ## History
504 -* v2.0, 2014-12-22, hotfix #264, ignore NALU when sequence header to make HLS happy. 2.0.76  
505 -* v2.0, 2014-12-20, hotfix #264, support disconnect publish connect when hls error. 2.0.75 504 +* v2.0, 2014-12-29, hotfix [#268](https://github.com/winlinvip/simple-rtmp-server/issues/268), the hls pcr is negative when startup. 2.0.78
  505 +* v2.0, 2014-12-22, hotfix [#264](https://github.com/winlinvip/simple-rtmp-server/issues/264), ignore NALU when sequence header to make HLS happy. 2.0.76
  506 +* v2.0, 2014-12-20, hotfix [#264](https://github.com/winlinvip/simple-rtmp-server/issues/264), support disconnect publish connect when hls error. 2.0.75
506 * v2.0, 2014-12-12, fix [#257](https://github.com/winlinvip/simple-rtmp-server/issues/257), support 0.1s+ latency. 2.0.70 507 * v2.0, 2014-12-12, fix [#257](https://github.com/winlinvip/simple-rtmp-server/issues/257), support 0.1s+ latency. 2.0.70
507 * v2.0, 2014-12-08, update wiki for mr([EN](https://github.com/winlinvip/simple-rtmp-server/wiki/v2_EN_LowLatency#merged-read), [CN](https://github.com/winlinvip/simple-rtmp-server/wiki/v2_CN_LowLatency#merged-read)) and mw([EN](https://github.com/winlinvip/simple-rtmp-server/wiki/v2_EN_LowLatency#merged-write), [CN](https://github.com/winlinvip/simple-rtmp-server/wiki/v2_CN_LowLatency#merged-write)). 508 * v2.0, 2014-12-08, update wiki for mr([EN](https://github.com/winlinvip/simple-rtmp-server/wiki/v2_EN_LowLatency#merged-read), [CN](https://github.com/winlinvip/simple-rtmp-server/wiki/v2_CN_LowLatency#merged-read)) and mw([EN](https://github.com/winlinvip/simple-rtmp-server/wiki/v2_EN_LowLatency#merged-write), [CN](https://github.com/winlinvip/simple-rtmp-server/wiki/v2_CN_LowLatency#merged-write)).
508 * v2.0, 2014-12-07, fix [#251](https://github.com/winlinvip/simple-rtmp-server/issues/251), 10k+ clients, use queue cond wait and fast vector. 2.0.67 509 * v2.0, 2014-12-07, fix [#251](https://github.com/winlinvip/simple-rtmp-server/issues/251), 10k+ clients, use queue cond wait and fast vector. 2.0.67
@@ -368,11 +368,16 @@ private: @@ -368,11 +368,16 @@ private:
368 } 368 }
369 static char* write_pcr(char* p, int64_t pcr) 369 static char* write_pcr(char* p, int64_t pcr)
370 { 370 {
371 - *p++ = (char) (pcr >> 25);  
372 - *p++ = (char) (pcr >> 17);  
373 - *p++ = (char) (pcr >> 9);  
374 - *p++ = (char) (pcr >> 1);  
375 - *p++ = (char) (pcr << 7 | 0x7e); 371 + // the pcr=dts-delay
  372 + // and the pcr maybe negative
  373 + // @see https://github.com/winlinvip/simple-rtmp-server/issues/268
  374 + int64_t v = srs_max(0, pcr);
  375 +
  376 + *p++ = (char) (v >> 25);
  377 + *p++ = (char) (v >> 17);
  378 + *p++ = (char) (v >> 9);
  379 + *p++ = (char) (v >> 1);
  380 + *p++ = (char) (v << 7 | 0x7e);
376 *p++ = 0; 381 *p++ = 0;
377 382
378 return p; 383 return p;
@@ -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 77 34 +#define VERSION_REVISION 78
35 // server info. 35 // server info.
36 #define RTMP_SIG_SRS_KEY "SRS" 36 #define RTMP_SIG_SRS_KEY "SRS"
37 #define RTMP_SIG_SRS_ROLE "origin/edge server" 37 #define RTMP_SIG_SRS_ROLE "origin/edge server"