mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix #268, the hls pcr is negative when startup. 1.0.14
This commit is contained in:
parent
e77e4cfb8b
commit
513c1ec6d5
3 changed files with 12 additions and 6 deletions
|
@ -368,11 +368,16 @@ private:
|
|||
}
|
||||
static char* write_pcr(char* p, int64_t pcr)
|
||||
{
|
||||
*p++ = (char) (pcr >> 25);
|
||||
*p++ = (char) (pcr >> 17);
|
||||
*p++ = (char) (pcr >> 9);
|
||||
*p++ = (char) (pcr >> 1);
|
||||
*p++ = (char) (pcr << 7 | 0x7e);
|
||||
// the pcr=dts-delay
|
||||
// and the pcr maybe negative
|
||||
// @see https://github.com/winlinvip/simple-rtmp-server/issues/268
|
||||
int64_t v = srs_max(0, pcr);
|
||||
|
||||
*p++ = (char) (v >> 25);
|
||||
*p++ = (char) (v >> 17);
|
||||
*p++ = (char) (v >> 9);
|
||||
*p++ = (char) (v >> 1);
|
||||
*p++ = (char) (v << 7 | 0x7e);
|
||||
*p++ = 0;
|
||||
|
||||
return p;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue