1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

refine hls, try to fix the hls ts corrupt problem.

This commit is contained in:
winlin 2015-02-10 19:09:31 +08:00
parent 828aadf858
commit 5a3cd235fd
4 changed files with 8 additions and 7 deletions

View file

@ -224,7 +224,7 @@ public:
if (first) {
first = false;
if (frame->key) {
if (frame->write_pcr) {
p[-1] |= 0x20; // Both Adaption and Payload
*p++ = 7; // size
*p++ = 0x50; // random access + PCR
@ -399,7 +399,7 @@ SrsMpegtsFrame::SrsMpegtsFrame()
{
pts = dts = 0;
pid = sid = cc = 0;
key = false;
write_pcr = false;
}
string srs_ts_stream2string(SrsTsStream stream)
@ -1971,7 +1971,7 @@ int SrsTsCache::cache_video(SrsAvcAacCodec* codec, int64_t dts, SrsCodecSample*
vf->pts = vf->dts + sample->cts * 90;
vf->pid = TS_VIDEO_PID;
vf->sid = TS_VIDEO_AVC;
vf->key = sample->frame_type == SrsCodecVideoAVCFrameKeyFrame;
vf->write_pcr = sample->frame_type == SrsCodecVideoAVCFrameKeyFrame;
return ret;
}