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

fix the aggregate bug, adjust to starttime of msg. 2.0.91

This commit is contained in:
winlin 2015-01-07 15:37:44 +08:00
parent 5aa31568ba
commit 0e9c9db3f4
3 changed files with 13 additions and 2 deletions

View file

@ -1481,6 +1481,9 @@ int SrsSource::on_aggregate(SrsCommonMessage* msg)
return ret;
}
// the aggregate message always use abs time.
int delta = -1;
while (!stream->empty()) {
if (!stream->require(1)) {
ret = ERROR_RTMP_AGGREGATE;
@ -1519,6 +1522,12 @@ int SrsSource::on_aggregate(SrsCommonMessage* msg)
timestamp |= time_h<<24;
timestamp &= 0x7FFFFFFF;
// adjust abs timestamp in aggregate msg.
if (delta < 0) {
delta = (int)msg->header.timestamp - (int)timestamp;
}
timestamp += delta;
if (!stream->require(3)) {
ret = ERROR_RTMP_AGGREGATE;
srs_error("invalid aggregate message stream_id. ret=%d", ret);