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

View file

@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version // current release version
#define VERSION_MAJOR 2 #define VERSION_MAJOR 2
#define VERSION_MINOR 0 #define VERSION_MINOR 0
#define VERSION_REVISION 90 #define VERSION_REVISION 91
// server info. // server info.
#define RTMP_SIG_SRS_KEY "SRS" #define RTMP_SIG_SRS_KEY "SRS"
#define RTMP_SIG_SRS_ROLE "origin/edge server" #define RTMP_SIG_SRS_ROLE "origin/edge server"

View file

@ -823,7 +823,9 @@ int __srs_rtmp_on_aggregate(Context* context, SrsCommonMessage* msg)
return ret; return ret;
} }
// the aggregate message always use abs time.
int delta = -1; int delta = -1;
while (!stream->empty()) { while (!stream->empty()) {
if (!stream->require(1)) { if (!stream->require(1)) {
ret = ERROR_RTMP_AGGREGATE; ret = ERROR_RTMP_AGGREGATE;
@ -862,7 +864,7 @@ int __srs_rtmp_on_aggregate(Context* context, SrsCommonMessage* msg)
timestamp |= time_h<<24; timestamp |= time_h<<24;
timestamp &= 0x7FFFFFFF; timestamp &= 0x7FFFFFFF;
// adjust timestamp. // adjust abs timestamp in aggregate msg.
if (delta < 0) { if (delta < 0) {
delta = (int)msg->header.timestamp - (int)timestamp; delta = (int)msg->header.timestamp - (int)timestamp;
} }