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

1,solve audio timestamp bugs;2,solve video dts increase bugs

This commit is contained in:
runner365 2020-02-29 16:47:20 +08:00
parent ed1a3aa37c
commit 7f4cc6221c
7 changed files with 186 additions and 23 deletions

View file

@ -259,11 +259,17 @@ int ts_demux::decode_unit(unsigned char* data_p, std::string key_path, TS_DATA_C
if(ts_header_info._payload_unit_start_indicator){
unsigned char* ret_data_p = nullptr;
size_t ret_size = 0;
uint64_t dts = 0;
uint64_t pts = 0;
//callback last media data in data buffer
on_callback(callback, _last_pid, key_path, _last_dts, _last_pts);
pes_parse(data_p+npos, npos, &ret_data_p, ret_size, _last_dts, _last_pts);
pes_parse(data_p+npos, npos, &ret_data_p, ret_size, dts, pts);
_last_pts = pts;
_last_dts = (dts == 0) ? pts : dts;
if ((ret_data_p != nullptr) && (ret_size > 0)) {
insert_into_databuf(ret_data_p, ret_size, key_path, ts_header_info._PID);
}