mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
for #151, refine pcr=dts-800ms and use dts/pts directly. 1.0.24
This commit is contained in:
parent
4f5cc9c403
commit
1835957a2b
2 changed files with 7 additions and 3 deletions
|
@ -385,6 +385,7 @@ Supported operating systems and hardware:
|
||||||
|
|
||||||
## History
|
## History
|
||||||
|
|
||||||
|
* v1.0, 2015-01-25, hotfix [#151](https://github.com/winlinvip/simple-rtmp-server/issues/151), refine pcr=dts-800ms and use dts/pts directly. 1.0.24
|
||||||
* v1.0, 2015-01-23, hotfix [#151](https://github.com/winlinvip/simple-rtmp-server/issues/151), use absolutely overflow to make jwplayer happy. 1.0.23
|
* v1.0, 2015-01-23, hotfix [#151](https://github.com/winlinvip/simple-rtmp-server/issues/151), use absolutely overflow to make jwplayer happy. 1.0.23
|
||||||
* v1.0, 2015-01-17, hotfix [#290](https://github.com/winlinvip/simple-rtmp-server/issues/290), use iformat only for rtmp input. 1.0.22
|
* v1.0, 2015-01-17, hotfix [#290](https://github.com/winlinvip/simple-rtmp-server/issues/290), use iformat only for rtmp input. 1.0.22
|
||||||
* <strong>v1.0, 2015-01-15, [1.0r1 release(1.0.21)](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0r1) released. 59472 lines.</strong>
|
* <strong>v1.0, 2015-01-15, [1.0r1 release(1.0.21)](https://github.com/winlinvip/simple-rtmp-server/releases/tag/1.0r1) released. 59472 lines.</strong>
|
||||||
|
|
|
@ -78,7 +78,9 @@ using namespace std;
|
||||||
|
|
||||||
// @see: NGX_RTMP_HLS_DELAY,
|
// @see: NGX_RTMP_HLS_DELAY,
|
||||||
// 63000: 700ms, ts_tbn=90000
|
// 63000: 700ms, ts_tbn=90000
|
||||||
#define SRS_AUTO_HLS_DELAY 63000
|
// 72000: 800ms, ts_tbn=90000
|
||||||
|
// @see https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-71352511
|
||||||
|
#define SRS_AUTO_HLS_DELAY 72000
|
||||||
|
|
||||||
// the mpegts header specifed the video/audio pid.
|
// the mpegts header specifed the video/audio pid.
|
||||||
#define TS_VIDEO_PID 256
|
#define TS_VIDEO_PID 256
|
||||||
|
@ -237,6 +239,7 @@ public:
|
||||||
p[-1] |= 0x20; // Both Adaption and Payload
|
p[-1] |= 0x20; // Both Adaption and Payload
|
||||||
*p++ = 7; // size
|
*p++ = 7; // size
|
||||||
*p++ = 0x50; // random access + PCR
|
*p++ = 0x50; // random access + PCR
|
||||||
|
// about the pcr, read https://github.com/winlinvip/simple-rtmp-server/issues/151#issuecomment-71352511
|
||||||
p = write_pcr(p, frame->dts - SRS_AUTO_HLS_DELAY);
|
p = write_pcr(p, frame->dts - SRS_AUTO_HLS_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,11 +296,11 @@ public:
|
||||||
*p++ = header_size;
|
*p++ = header_size;
|
||||||
|
|
||||||
// pts; // 33bits
|
// pts; // 33bits
|
||||||
p = write_pts(p, flags >> 6, frame->pts + SRS_AUTO_HLS_DELAY);
|
p = write_pts(p, flags >> 6, frame->pts);
|
||||||
|
|
||||||
// dts; // 33bits
|
// dts; // 33bits
|
||||||
if (frame->dts != frame->pts) {
|
if (frame->dts != frame->pts) {
|
||||||
p = write_pts(p, 1, frame->dts + SRS_AUTO_HLS_DELAY);
|
p = write_pts(p, 1, frame->dts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue